001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.dynamicdatamapping.service; 016 017 import com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 020 import com.liferay.portal.kernel.transaction.Isolation; 021 import com.liferay.portal.kernel.transaction.Propagation; 022 import com.liferay.portal.kernel.transaction.Transactional; 023 import com.liferay.portal.security.ac.AccessControlled; 024 import com.liferay.portal.service.BaseService; 025 026 /** 027 * The interface for the d d m structure remote service. 028 * 029 * <p> 030 * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely. 031 * </p> 032 * 033 * @author Brian Wing Shun Chan 034 * @see DDMStructureServiceUtil 035 * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMStructureServiceBaseImpl 036 * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureServiceImpl 037 * @generated 038 */ 039 @AccessControlled 040 @JSONWebService 041 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 042 PortalException.class, SystemException.class}) 043 public interface DDMStructureService extends BaseService { 044 /* 045 * NOTE FOR DEVELOPERS: 046 * 047 * Never modify or reference this interface directly. Always use {@link DDMStructureServiceUtil} to access the d d m structure remote service. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 048 */ 049 050 /** 051 * Returns the Spring bean ID for this bean. 052 * 053 * @return the Spring bean ID for this bean 054 */ 055 public java.lang.String getBeanIdentifier(); 056 057 /** 058 * Sets the Spring bean ID for this bean. 059 * 060 * @param beanIdentifier the Spring bean ID for this bean 061 */ 062 public void setBeanIdentifier(java.lang.String beanIdentifier); 063 064 /** 065 * Adds a structure referencing a default parent structure, using the portal 066 * property <code>dynamic.data.lists.storage.type</code> storage type and 067 * default structure type. 068 * 069 * @param userId the primary key of the structure's creator/owner 070 * @param groupId the primary key of the group 071 * @param classNameId the primary key of the class name for the structure's 072 related model 073 * @param nameMap the structure's locales and localized names 074 * @param descriptionMap the structure's locales and localized descriptions 075 * @param xsd the structure's XML schema definition 076 * @param serviceContext the structure's service context. Can set the UUID, 077 creation date, modification date, guest permissions, and group 078 permissions for the structure. 079 * @return the structure 080 * @throws PortalException if a user with the primary key could not be 081 found, if the user did not have permission to add the structure, 082 if the XSD was not well-formed, or if a portal exception occurred 083 * @throws SystemException if a system exception occurred 084 */ 085 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure( 086 long userId, long groupId, long classNameId, 087 java.util.Map<java.util.Locale, java.lang.String> nameMap, 088 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 089 java.lang.String xsd, 090 com.liferay.portal.service.ServiceContext serviceContext) 091 throws com.liferay.portal.kernel.exception.PortalException, 092 com.liferay.portal.kernel.exception.SystemException; 093 094 /** 095 * Adds a structure referencing its parent structure. 096 * 097 * @param groupId the primary key of the group 098 * @param parentStructureId the primary key of the parent structure 099 (optionally {@link 100 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants#DEFAULT_PARENT_STRUCTURE_ID}) 101 * @param classNameId the primary key of the class name for the structure's 102 related model 103 * @param structureKey the unique string identifying the structure 104 (optionally <code>null</code>) 105 * @param nameMap the structure's locales and localized names 106 * @param descriptionMap the structure's locales and localized descriptions 107 * @param xsd the structure's XML schema definition 108 * @param storageType the structure's storage type. It can be "xml" or 109 "expando". For more information, see {@link 110 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 111 * @param type the structure's type. For more information, see {@link 112 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 113 * @param serviceContext the structure's service context. Can set the UUID, 114 creation date, modification date, guest permissions, and group 115 permissions for the structure. 116 * @return the structure 117 * @throws PortalException if the user did not have permission to add the 118 structure, if the XSD is not well formed, or if a portal 119 exception occurred 120 * @throws SystemException if a system exception occurred 121 */ 122 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure( 123 long groupId, long parentStructureId, long classNameId, 124 java.lang.String structureKey, 125 java.util.Map<java.util.Locale, java.lang.String> nameMap, 126 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 127 java.lang.String xsd, java.lang.String storageType, int type, 128 com.liferay.portal.service.ServiceContext serviceContext) 129 throws com.liferay.portal.kernel.exception.PortalException, 130 com.liferay.portal.kernel.exception.SystemException; 131 132 /** 133 * Adds a structure referencing the parent structure by its structure key. 134 * In case the parent structure is not found, it uses the default parent 135 * structure ID. 136 * 137 * @param userId the primary key of the structure's creator/owner 138 * @param groupId the primary key of the group 139 * @param parentStructureKey the unique string identifying the structure 140 * @param classNameId the primary key of the class name for the structure's 141 related model 142 * @param structureKey unique string identifying the structure (optionally 143 <code>null</code>) 144 * @param nameMap the structure's locales and localized names 145 * @param descriptionMap the structure's locales and localized descriptions 146 * @param xsd the XML schema definition of the structure 147 * @param storageType the storage type of the structure. It can be XML or 148 expando. For more information, see {@link 149 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 150 * @param type the structure's type. For more information, see {@link 151 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 152 * @param serviceContext the service context to be applied. Must have the 153 <code>ddmResource</code> attribute to check permissions. Can set 154 the UUID, creation date, modification date, guest permissions, 155 and group permissions for the structure. 156 * @return the structure 157 * @throws PortalException if a user with the primary key could not be 158 found, if the user did not have permission to add the structure, 159 if the XSD was not well-formed, or if a portal exception occurred 160 * @throws SystemException if a system exception occurred 161 */ 162 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure( 163 long userId, long groupId, java.lang.String parentStructureKey, 164 long classNameId, java.lang.String structureKey, 165 java.util.Map<java.util.Locale, java.lang.String> nameMap, 166 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 167 java.lang.String xsd, java.lang.String storageType, int type, 168 com.liferay.portal.service.ServiceContext serviceContext) 169 throws com.liferay.portal.kernel.exception.PortalException, 170 com.liferay.portal.kernel.exception.SystemException; 171 172 /** 173 * Copies a structure, creating a new structure with all the values 174 * extracted from the original one. The new structure supports a new name 175 * and description. 176 * 177 * @param structureId the primary key of the structure to be copied 178 * @param nameMap the new structure's locales and localized names 179 * @param descriptionMap the new structure's locales and localized 180 descriptions 181 * @param serviceContext the service context to be applied. Can set the 182 UUID, creation date, modification date, guest permissions, and 183 group permissions for the structure. 184 * @return the new structure 185 * @throws PortalException if the user did not have permission to add the 186 structure or if a portal exception occurred 187 * @throws SystemException if a system exception occurred 188 */ 189 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure copyStructure( 190 long structureId, 191 java.util.Map<java.util.Locale, java.lang.String> nameMap, 192 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 193 com.liferay.portal.service.ServiceContext serviceContext) 194 throws com.liferay.portal.kernel.exception.PortalException, 195 com.liferay.portal.kernel.exception.SystemException; 196 197 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure copyStructure( 198 long structureId, 199 com.liferay.portal.service.ServiceContext serviceContext) 200 throws com.liferay.portal.kernel.exception.PortalException, 201 com.liferay.portal.kernel.exception.SystemException; 202 203 /** 204 * Deletes the structure and its resources. 205 * 206 * <p> 207 * Before deleting the structure, the system verifies whether the structure 208 * is required by another entity. If it is needed, an exception is thrown. 209 * </p> 210 * 211 * @param structureId the primary key of the structure to be deleted 212 * @throws PortalException if the user did not have permission to delete the 213 structure or if a portal exception occurred 214 * @throws SystemException if a system exception occurred 215 */ 216 public void deleteStructure(long structureId) 217 throws com.liferay.portal.kernel.exception.PortalException, 218 com.liferay.portal.kernel.exception.SystemException; 219 220 /** 221 * Returns the structure matching the class name ID, structure key, and 222 * group. 223 * 224 * @param groupId the primary key of the group 225 * @param classNameId the primary key of the class name for the structure's 226 related model 227 * @param structureKey the unique string identifying the structure 228 * @return the matching structure, or <code>null</code> if a matching 229 structure could not be found 230 * @throws PortalException if the user did not have permission to view the 231 structure or if a portal exception occurred 232 * @throws SystemException if a system exception occurred 233 */ 234 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 235 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure fetchStructure( 236 long groupId, long classNameId, java.lang.String structureKey) 237 throws com.liferay.portal.kernel.exception.PortalException, 238 com.liferay.portal.kernel.exception.SystemException; 239 240 /** 241 * Returns the structure with the ID. 242 * 243 * @param structureId the primary key of the structure 244 * @return the structure with the ID 245 * @throws PortalException if the user did not have permission to view the 246 structure or if a structure with the ID could not be found 247 * @throws SystemException if a system exception occurred 248 */ 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure( 251 long structureId) 252 throws com.liferay.portal.kernel.exception.PortalException, 253 com.liferay.portal.kernel.exception.SystemException; 254 255 /** 256 * Returns the structure matching the class name ID, structure key, and 257 * group. 258 * 259 * @param groupId the primary key of the structure's group 260 * @param classNameId the primary key of the class name for the structure's 261 related model 262 * @param structureKey the unique string identifying the structure 263 * @return the matching structure 264 * @throws PortalException if the user did not have permission to view the 265 structure or if a matching structure could not be found 266 * @throws SystemException if a system exception occurred 267 */ 268 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 269 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure( 270 long groupId, long classNameId, java.lang.String structureKey) 271 throws com.liferay.portal.kernel.exception.PortalException, 272 com.liferay.portal.kernel.exception.SystemException; 273 274 /** 275 * Returns the structure matching the class name ID, structure key, and 276 * group, optionally in the global scope. 277 * 278 * <p> 279 * This method first searches in the group. If the structure is still not 280 * found and <code>includeGlobalStructures</code> is set to 281 * <code>true</code>, this method searches the global group. 282 * </p> 283 * 284 * @param groupId the primary key of the structure's group 285 * @param classNameId the primary key of the class name for the structure's 286 related model 287 * @param structureKey the unique string identifying the structure 288 * @param includeGlobalStructures whether to include the global scope in 289 the search 290 * @return the matching structure 291 * @throws PortalException if the user did not have permission to view the 292 structure or if a matching structure could not be found 293 * @throws SystemException if a system exception occurred 294 */ 295 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 296 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure( 297 long groupId, long classNameId, java.lang.String structureKey, 298 boolean includeGlobalStructures) 299 throws com.liferay.portal.kernel.exception.PortalException, 300 com.liferay.portal.kernel.exception.SystemException; 301 302 /** 303 * Returns all the structures in the group that the user has permission to 304 * view. 305 * 306 * @param groupId the primary key of the group 307 * @return the structures in the group that the user has permission to view 308 * @throws SystemException if a system exception occurred 309 */ 310 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 311 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures( 312 long groupId) 313 throws com.liferay.portal.kernel.exception.SystemException; 314 315 /** 316 * Returns all the structures in the groups that the user has permission to 317 * view. 318 * 319 * @param groupIds the primary key of the groups 320 * @return the structures in the groups that the user has permission to view 321 * @throws SystemException if a system exception occurred 322 */ 323 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 324 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures( 325 long[] groupIds) 326 throws com.liferay.portal.kernel.exception.SystemException; 327 328 /** 329 * Returns an ordered range of all the structures matching the groups and 330 * class name IDs, and matching the keywords in the structure names and 331 * descriptions. 332 * 333 * <p> 334 * Useful when paginating results. Returns a maximum of <code>end - 335 * start</code> instances. <code>start</code> and <code>end</code> are not 336 * primary keys, they are indexes in the result set. Thus, <code>0</code> 337 * refers to the first result in the set. Setting both <code>start</code> 338 * and <code>end</code> to {@link 339 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 340 * result set. 341 * </p> 342 * 343 * @param companyId the primary key of the structure's company 344 * @param groupIds the primary keys of the groups 345 * @param classNameIds the primary keys of the class names of the models 346 the structures are related to 347 * @param keywords the keywords (space separated), which may occur in the 348 structure's name or description (optionally <code>null</code>) 349 * @param start the lower bound of the range of structures to return 350 * @param end the upper bound of the range of structures to return (not 351 inclusive) 352 * @param orderByComparator the comparator to order the structures 353 (optionally <code>null</code>) 354 * @return the range of matching structures ordered by the comparator 355 * @throws SystemException if a system exception occurred 356 */ 357 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 358 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search( 359 long companyId, long[] groupIds, long[] classNameIds, 360 java.lang.String keywords, int start, int end, 361 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 362 throws com.liferay.portal.kernel.exception.SystemException; 363 364 /** 365 * Returns an ordered range of all the structures matching the groups, class 366 * name IDs, name keyword, description keyword, storage type, and type. 367 * 368 * <p> 369 * Useful when paginating results. Returns a maximum of <code>end - 370 * start</code> instances. <code>start</code> and <code>end</code> are not 371 * primary keys, they are indexes in the result set. Thus, <code>0</code> 372 * refers to the first result in the set. Setting both <code>start</code> 373 * and <code>end</code> to {@link 374 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 375 * result set. 376 * </p> 377 * 378 * @param companyId the primary key of the structure's company 379 * @param groupIds the primary keys of the groups 380 * @param classNameIds the primary keys of the class names of the models 381 the structures are related to 382 * @param name the name keywords 383 * @param description the description keywords 384 * @param storageType the structure's storage type. It can be "xml" or 385 "expando". For more information, see {@link 386 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 387 * @param type the structure's type. For more information, see {@link 388 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 389 * @param andOperator whether every field must match its keywords, or just 390 one field 391 * @param start the lower bound of the range of structures to return 392 * @param end the upper bound of the range of structures to return (not 393 inclusive) 394 * @param orderByComparator the comparator to order the structures 395 (optionally <code>null</code>) 396 * @return the range of matching structures ordered by the comparator 397 * @throws SystemException if a system exception occurred 398 */ 399 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 400 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search( 401 long companyId, long[] groupIds, long[] classNameIds, 402 java.lang.String name, java.lang.String description, 403 java.lang.String storageType, int type, boolean andOperator, int start, 404 int end, 405 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 406 throws com.liferay.portal.kernel.exception.SystemException; 407 408 /** 409 * Returns the number of structures matching the groups and class name IDs, 410 * and matching the keywords in the structure names and descriptions. 411 * 412 * @param companyId the primary key of the structure's company 413 * @param groupIds the primary keys of the groups 414 * @param classNameIds the primary keys of the class names of the models 415 the structures are related to 416 * @param keywords the keywords (space separated), which may occur in the 417 structure's name or description (optionally <code>null</code>) 418 * @return the number of matching structures 419 * @throws SystemException if a system exception occurred 420 */ 421 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 422 public int searchCount(long companyId, long[] groupIds, 423 long[] classNameIds, java.lang.String keywords) 424 throws com.liferay.portal.kernel.exception.SystemException; 425 426 /** 427 * Returns the number of structures matching the groups, class name IDs, 428 * name keyword, description keyword, storage type, and type 429 * 430 * @param companyId the primary key of the structure's company 431 * @param groupIds the primary keys of the groups 432 * @param classNameIds the primary keys of the class names of the models 433 the structure's are related to 434 * @param name the name keywords 435 * @param description the description keywords 436 * @param storageType the structure's storage type. It can be "xml" or 437 "expando". For more information, see {@link 438 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 439 * @param type the structure's type. For more information, see {@link 440 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 441 * @param andOperator whether every field must match its keywords, or just 442 one field 443 * @return the number of matching structures 444 * @throws SystemException if a system exception occurred 445 */ 446 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 447 public int searchCount(long companyId, long[] groupIds, 448 long[] classNameIds, java.lang.String name, 449 java.lang.String description, java.lang.String storageType, int type, 450 boolean andOperator) 451 throws com.liferay.portal.kernel.exception.SystemException; 452 453 /** 454 * Updates the structure matching the class name ID, structure key, and 455 * group, replacing its old parent structure, name map, description map, and 456 * XSD with new ones. 457 * 458 * @param groupId the primary key of the group 459 * @param parentStructureId the primary key of the new parent structure 460 * @param classNameId the primary key of the class name for the structure's 461 related model 462 * @param structureKey the unique string identifying the structure 463 * @param nameMap the structure's new locales and localized names 464 * @param descriptionMap the structure's new locales and localized 465 description 466 * @param xsd the structure's new XML schema definition 467 * @param serviceContext the service context to be applied. Can set the 468 modification date. 469 * @return the updated structure 470 * @throws PortalException if the user did not have permission to update the 471 structure or if a portal exception occurred 472 * @throws SystemException if a system exception occurred 473 */ 474 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure( 475 long groupId, long parentStructureId, long classNameId, 476 java.lang.String structureKey, 477 java.util.Map<java.util.Locale, java.lang.String> nameMap, 478 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 479 java.lang.String xsd, 480 com.liferay.portal.service.ServiceContext serviceContext) 481 throws com.liferay.portal.kernel.exception.PortalException, 482 com.liferay.portal.kernel.exception.SystemException; 483 484 /** 485 * Updates the structure matching the structure ID, replacing the old parent 486 * structure ID, name map, description map, and XSD with the new values. 487 * 488 * @param structureId the primary key of the structure 489 * @param parentStructureId the new parent structure primary key 490 * @param nameMap the structure's new locales and localized names 491 * @param descriptionMap the structure's new locales and localized 492 description 493 * @param xsd the new XML schema definition of the structure 494 * @param serviceContext the service context to be applied. Can set the 495 modification date. 496 * @return the updated structure 497 * @throws PortalException if the user did not have permission to update the 498 structure or if a portal exception occurred 499 * @throws SystemException if a system exception occurred 500 */ 501 public com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure( 502 long structureId, long parentStructureId, 503 java.util.Map<java.util.Locale, java.lang.String> nameMap, 504 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 505 java.lang.String xsd, 506 com.liferay.portal.service.ServiceContext serviceContext) 507 throws com.liferay.portal.kernel.exception.PortalException, 508 com.liferay.portal.kernel.exception.SystemException; 509 }