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