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