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 com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.transaction.Isolation; 020 import com.liferay.portal.kernel.transaction.Propagation; 021 import com.liferay.portal.kernel.transaction.Transactional; 022 import com.liferay.portal.service.BaseLocalService; 023 import com.liferay.portal.service.PersistedModelLocalService; 024 025 /** 026 * The interface for the d d m template local service. 027 * 028 * <p> 029 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 030 * </p> 031 * 032 * @author Brian Wing Shun Chan 033 * @see DDMTemplateLocalServiceUtil 034 * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateLocalServiceBaseImpl 035 * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl 036 * @generated 037 */ 038 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 039 PortalException.class, SystemException.class}) 040 public interface DDMTemplateLocalService extends BaseLocalService, 041 PersistedModelLocalService { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify or reference this interface directly. Always use {@link DDMTemplateLocalServiceUtil} to access the d d m template local service. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 046 */ 047 048 /** 049 * Adds the d d m template to the database. Also notifies the appropriate model listeners. 050 * 051 * @param ddmTemplate the d d m template 052 * @return the d d m template that was added 053 * @throws SystemException if a system exception occurred 054 */ 055 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addDDMTemplate( 056 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) 057 throws com.liferay.portal.kernel.exception.SystemException; 058 059 /** 060 * Creates a new d d m template with the primary key. Does not add the d d m template to the database. 061 * 062 * @param templateId the primary key for the new d d m template 063 * @return the new d d m template 064 */ 065 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate createDDMTemplate( 066 long templateId); 067 068 /** 069 * Deletes the d d m template with the primary key from the database. Also notifies the appropriate model listeners. 070 * 071 * @param templateId the primary key of the d d m template 072 * @return the d d m template that was removed 073 * @throws PortalException if a d d m template with the primary key could not be found 074 * @throws SystemException if a system exception occurred 075 */ 076 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate deleteDDMTemplate( 077 long templateId) 078 throws com.liferay.portal.kernel.exception.PortalException, 079 com.liferay.portal.kernel.exception.SystemException; 080 081 /** 082 * Deletes the d d m template from the database. Also notifies the appropriate model listeners. 083 * 084 * @param ddmTemplate the d d m template 085 * @return the d d m template that was removed 086 * @throws SystemException if a system exception occurred 087 */ 088 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate deleteDDMTemplate( 089 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) 090 throws com.liferay.portal.kernel.exception.SystemException; 091 092 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 093 094 /** 095 * Performs a dynamic query on the database and returns the matching rows. 096 * 097 * @param dynamicQuery the dynamic query 098 * @return the matching rows 099 * @throws SystemException if a system exception occurred 100 */ 101 @SuppressWarnings("rawtypes") 102 public java.util.List dynamicQuery( 103 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 104 throws com.liferay.portal.kernel.exception.SystemException; 105 106 /** 107 * Performs a dynamic query on the database and returns a range of the matching rows. 108 * 109 * <p> 110 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 111 * </p> 112 * 113 * @param dynamicQuery the dynamic query 114 * @param start the lower bound of the range of model instances 115 * @param end the upper bound of the range of model instances (not inclusive) 116 * @return the range of matching rows 117 * @throws SystemException if a system exception occurred 118 */ 119 @SuppressWarnings("rawtypes") 120 public java.util.List dynamicQuery( 121 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 122 int end) throws com.liferay.portal.kernel.exception.SystemException; 123 124 /** 125 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 126 * 127 * <p> 128 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 129 * </p> 130 * 131 * @param dynamicQuery the dynamic query 132 * @param start the lower bound of the range of model instances 133 * @param end the upper bound of the range of model instances (not inclusive) 134 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 135 * @return the ordered range of matching rows 136 * @throws SystemException if a system exception occurred 137 */ 138 @SuppressWarnings("rawtypes") 139 public java.util.List dynamicQuery( 140 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 141 int end, 142 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 143 throws com.liferay.portal.kernel.exception.SystemException; 144 145 /** 146 * Returns the number of rows that match the dynamic query. 147 * 148 * @param dynamicQuery the dynamic query 149 * @return the number of rows that match the dynamic query 150 * @throws SystemException if a system exception occurred 151 */ 152 public long dynamicQueryCount( 153 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 154 throws com.liferay.portal.kernel.exception.SystemException; 155 156 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 157 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchDDMTemplate( 158 long templateId) 159 throws com.liferay.portal.kernel.exception.SystemException; 160 161 /** 162 * Returns the d d m template with the primary key. 163 * 164 * @param templateId the primary key of the d d m template 165 * @return the d d m template 166 * @throws PortalException if a d d m template with the primary key could not be found 167 * @throws SystemException if a system exception occurred 168 */ 169 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 170 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getDDMTemplate( 171 long templateId) 172 throws com.liferay.portal.kernel.exception.PortalException, 173 com.liferay.portal.kernel.exception.SystemException; 174 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public com.liferay.portal.model.PersistedModel getPersistedModel( 177 java.io.Serializable primaryKeyObj) 178 throws com.liferay.portal.kernel.exception.PortalException, 179 com.liferay.portal.kernel.exception.SystemException; 180 181 /** 182 * Returns the d d m template matching the UUID and group. 183 * 184 * @param uuid the d d m template's UUID 185 * @param groupId the primary key of the group 186 * @return the matching d d m template 187 * @throws PortalException if a matching d d m template could not be found 188 * @throws SystemException if a system exception occurred 189 */ 190 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 191 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getDDMTemplateByUuidAndGroupId( 192 java.lang.String uuid, long groupId) 193 throws com.liferay.portal.kernel.exception.PortalException, 194 com.liferay.portal.kernel.exception.SystemException; 195 196 /** 197 * Returns a range of all the d d m templates. 198 * 199 * <p> 200 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 201 * </p> 202 * 203 * @param start the lower bound of the range of d d m templates 204 * @param end the upper bound of the range of d d m templates (not inclusive) 205 * @return the range of d d m templates 206 * @throws SystemException if a system exception occurred 207 */ 208 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 209 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getDDMTemplates( 210 int start, int end) 211 throws com.liferay.portal.kernel.exception.SystemException; 212 213 /** 214 * Returns the number of d d m templates. 215 * 216 * @return the number of d d m templates 217 * @throws SystemException if a system exception occurred 218 */ 219 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 220 public int getDDMTemplatesCount() 221 throws com.liferay.portal.kernel.exception.SystemException; 222 223 /** 224 * Updates the d d m template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 225 * 226 * @param ddmTemplate the d d m template 227 * @return the d d m template that was updated 228 * @throws SystemException if a system exception occurred 229 */ 230 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateDDMTemplate( 231 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) 232 throws com.liferay.portal.kernel.exception.SystemException; 233 234 /** 235 * Returns the Spring bean ID for this bean. 236 * 237 * @return the Spring bean ID for this bean 238 */ 239 public java.lang.String getBeanIdentifier(); 240 241 /** 242 * Sets the Spring bean ID for this bean. 243 * 244 * @param beanIdentifier the Spring bean ID for this bean 245 */ 246 public void setBeanIdentifier(java.lang.String beanIdentifier); 247 248 /** 249 * Adds a template. 250 * 251 * @param userId the primary key of the template's creator/owner 252 * @param groupId the primary key of the group 253 * @param classNameId the primary key of the class name for the template's 254 related model 255 * @param classPK the primary key of the template's related entity 256 * @param nameMap the template's locales and localized names 257 * @param descriptionMap the template's locales and localized descriptions 258 * @param type the template's type. For more information, see {@link 259 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 260 * @param mode the template's mode. For more information, see {@link 261 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 262 * @param language the template's script language. For more information, 263 see {@link 264 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 265 * @param script the template's script 266 * @param serviceContext the service context to be applied. Can set the 267 UUID, creation date, modification date, guest permissions, and 268 group permissions for the template. 269 * @return the template 270 * @throws PortalException if a portal exception occurred 271 * @throws SystemException if a system exception occurred 272 */ 273 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate( 274 long userId, long groupId, long classNameId, long classPK, 275 java.util.Map<java.util.Locale, java.lang.String> nameMap, 276 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 277 java.lang.String type, java.lang.String mode, 278 java.lang.String language, java.lang.String script, 279 com.liferay.portal.service.ServiceContext serviceContext) 280 throws com.liferay.portal.kernel.exception.PortalException, 281 com.liferay.portal.kernel.exception.SystemException; 282 283 /** 284 * Adds a template with additional parameters. 285 * 286 * @param userId the primary key of the template's creator/owner 287 * @param groupId the primary key of the group 288 * @param classNameId the primary key of the class name for the template's 289 related model 290 * @param classPK the primary key of the template's related entity 291 * @param templateKey the unique string identifying the template 292 (optionally <code>null</code>) 293 * @param nameMap the template's locales and localized names 294 * @param descriptionMap the template's locales and localized descriptions 295 * @param type the template's type. For more information, see {@link 296 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 297 * @param mode the template's mode. For more information, see {@link 298 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 299 * @param language the template's script language. For more information, 300 see {@link 301 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 302 * @param script the template's script 303 * @param cacheable whether the template is cacheable 304 * @param smallImage whether the template has a small image 305 * @param smallImageURL the template's small image URL (optionally 306 <code>null</code>) 307 * @param smallImageFile the template's small image file (optionally 308 <code>null</code>) 309 * @param serviceContext the service context to be applied. Can set the 310 UUID, creation date, modification date, guest permissions, and 311 group permissions for the template. 312 * @return the template 313 * @throws PortalException if a portal exception occurred 314 * @throws SystemException if a system exception occurred 315 */ 316 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate( 317 long userId, long groupId, long classNameId, long classPK, 318 java.lang.String templateKey, 319 java.util.Map<java.util.Locale, java.lang.String> nameMap, 320 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 321 java.lang.String type, java.lang.String mode, 322 java.lang.String language, java.lang.String script, boolean cacheable, 323 boolean smallImage, java.lang.String smallImageURL, 324 java.io.File smallImageFile, 325 com.liferay.portal.service.ServiceContext serviceContext) 326 throws com.liferay.portal.kernel.exception.PortalException, 327 com.liferay.portal.kernel.exception.SystemException; 328 329 /** 330 * Adds the resources to the template. 331 * 332 * @param template the template to add resources to 333 * @param addGroupPermissions whether to add group permissions 334 * @param addGuestPermissions whether to add guest permissions 335 * @throws PortalException if a portal exception occurred 336 * @throws SystemException if a system exception occurred 337 */ 338 public void addTemplateResources( 339 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template, 340 boolean addGroupPermissions, boolean addGuestPermissions) 341 throws com.liferay.portal.kernel.exception.PortalException, 342 com.liferay.portal.kernel.exception.SystemException; 343 344 /** 345 * Adds the model resources with the permissions to the template. 346 * 347 * @param template the template to add resources to 348 * @param groupPermissions the group permissions to be added 349 * @param guestPermissions the guest permissions to be added 350 * @throws PortalException if a portal exception occurred 351 * @throws SystemException if a system exception occurred 352 */ 353 public void addTemplateResources( 354 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template, 355 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 356 throws com.liferay.portal.kernel.exception.PortalException, 357 com.liferay.portal.kernel.exception.SystemException; 358 359 /** 360 * Copies the template, creating a new template with all the values 361 * extracted from the original one. This method supports defining a new name 362 * and description. 363 * 364 * @param userId the primary key of the template's creator/owner 365 * @param templateId the primary key of the template to be copied 366 * @param nameMap the new template's locales and localized names 367 * @param descriptionMap the new template's locales and localized 368 descriptions 369 * @param serviceContext the service context to be applied. Can set the 370 UUID, creation date, modification date, guest permissions, and 371 group permissions for the template. 372 * @return the new template 373 * @throws PortalException if a portal exception occurred 374 * @throws SystemException if a system exception occurred 375 */ 376 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate( 377 long userId, long templateId, 378 java.util.Map<java.util.Locale, java.lang.String> nameMap, 379 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 380 com.liferay.portal.service.ServiceContext serviceContext) 381 throws com.liferay.portal.kernel.exception.PortalException, 382 com.liferay.portal.kernel.exception.SystemException; 383 384 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate( 385 long userId, long templateId, 386 com.liferay.portal.service.ServiceContext serviceContext) 387 throws com.liferay.portal.kernel.exception.PortalException, 388 com.liferay.portal.kernel.exception.SystemException; 389 390 /** 391 * Copies all the templates matching the class name ID, class PK, and type. 392 * This method creates new templates, extracting all the values from the old 393 * ones and updating their class PKs. 394 * 395 * @param userId the primary key of the template's creator/owner 396 * @param classNameId the primary key of the class name for the template's 397 related model 398 * @param oldClassPK the primary key of the old template's related entity 399 * @param newClassPK the primary key of the new template's related entity 400 * @param type the template's type. For more information, see {@link 401 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 402 * @param serviceContext the service context to be applied. Can set the 403 creation date, modification date, guest permissions, and group 404 permissions for the new templates. 405 * @return the new templates 406 * @throws PortalException if a portal exception occurred 407 * @throws SystemException if a system exception occurred 408 */ 409 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> copyTemplates( 410 long userId, long classNameId, long oldClassPK, long newClassPK, 411 java.lang.String type, 412 com.liferay.portal.service.ServiceContext serviceContext) 413 throws com.liferay.portal.kernel.exception.PortalException, 414 com.liferay.portal.kernel.exception.SystemException; 415 416 /** 417 * Deletes the template and its resources. 418 * 419 * @param template the template to be deleted 420 * @throws PortalException if a portal exception occurred 421 * @throws SystemException if a system exception occurred 422 */ 423 public void deleteTemplate( 424 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template) 425 throws com.liferay.portal.kernel.exception.PortalException, 426 com.liferay.portal.kernel.exception.SystemException; 427 428 /** 429 * Deletes the template and its resources. 430 * 431 * @param templateId the primary key of the template to be deleted 432 * @throws PortalException if a portal exception occurred 433 * @throws SystemException if a system exception occurred 434 */ 435 public void deleteTemplate(long templateId) 436 throws com.liferay.portal.kernel.exception.PortalException, 437 com.liferay.portal.kernel.exception.SystemException; 438 439 /** 440 * Deletes all the templates of the group. 441 * 442 * @param groupId the primary key of the group 443 * @throws PortalException if a portal exception occurred 444 * @throws SystemException if a system exception occurred 445 */ 446 public void deleteTemplates(long groupId) 447 throws com.liferay.portal.kernel.exception.PortalException, 448 com.liferay.portal.kernel.exception.SystemException; 449 450 /** 451 * Returns the template matching the group and template key. 452 * 453 * @param groupId the primary key of the group 454 * @param classNameId the primary key of the class name for the template's 455 related model 456 * @param templateKey the unique string identifying the template 457 * @return the matching template, or <code>null</code> if a matching 458 template could not be found 459 * @throws SystemException if a system exception occurred 460 */ 461 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 462 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 463 long groupId, long classNameId, java.lang.String templateKey) 464 throws com.liferay.portal.kernel.exception.SystemException; 465 466 /** 467 * Returns the template matching the group and template key, optionally in 468 * the global scope. 469 * 470 * <p> 471 * This method first searches in the given group. If the template is still 472 * not found and <code>includeGlobalTemplates</code> is set to 473 * <code>true</code>, this method searches the global group. 474 * </p> 475 * 476 * @param groupId the primary key of the group 477 * @param classNameId the primary key of the class name for the template's 478 related model 479 * @param templateKey the unique string identifying the template 480 * @param includeGlobalTemplates whether to include the global scope in the 481 search 482 * @return the matching template, or <code>null</code> if a matching 483 template could not be found 484 * @throws PortalException if a portal exception occurred 485 * @throws SystemException if a system exception occurred 486 */ 487 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 488 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 489 long groupId, long classNameId, java.lang.String templateKey, 490 boolean includeGlobalTemplates) 491 throws com.liferay.portal.kernel.exception.PortalException, 492 com.liferay.portal.kernel.exception.SystemException; 493 494 /** 495 * Returns the template matching the UUID and group. 496 * 497 * @param uuid the unique string identifying the template 498 * @param groupId the primary key of the group 499 * @return the matching template, or <code>null</code> if a matching 500 template could not be found 501 * @throws SystemException if a system exception occurred 502 */ 503 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 504 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 505 java.lang.String uuid, long groupId) 506 throws com.liferay.portal.kernel.exception.SystemException; 507 508 /** 509 * Returns the template with the ID. 510 * 511 * @param templateId the primary key of the template 512 * @return the template with the ID 513 * @throws PortalException if a matching template could not be found 514 * @throws SystemException if a system exception occurred 515 */ 516 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 517 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 518 long templateId) 519 throws com.liferay.portal.kernel.exception.PortalException, 520 com.liferay.portal.kernel.exception.SystemException; 521 522 /** 523 * Returns the template matching the group and template key. 524 * 525 * @param groupId the primary key of the group 526 * @param classNameId the primary key of the class name for the template's 527 related model 528 * @param templateKey the unique string identifying the template 529 * @return the matching template 530 * @throws PortalException if a matching template could not be found 531 * @throws SystemException if a system exception occurred 532 */ 533 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 534 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 535 long groupId, long classNameId, java.lang.String templateKey) 536 throws com.liferay.portal.kernel.exception.PortalException, 537 com.liferay.portal.kernel.exception.SystemException; 538 539 /** 540 * Returns the template matching the group and template key, optionally in 541 * the global scope. 542 * 543 * <p> 544 * This method first searches in the group. If the template is still not 545 * found and <code>includeGlobalTemplates</code> is set to 546 * <code>true</code>, this method searches the global group. 547 * </p> 548 * 549 * @param groupId the primary key of the group 550 * @param classNameId the primary key of the class name for the template's 551 related model 552 * @param templateKey the unique string identifying the template 553 * @param includeGlobalTemplates whether to include the global scope in the 554 search 555 * @return the matching template 556 * @throws PortalException if a matching template could not be found 557 * @throws SystemException if a system exception occurred 558 */ 559 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 560 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 561 long groupId, long classNameId, java.lang.String templateKey, 562 boolean includeGlobalTemplates) 563 throws com.liferay.portal.kernel.exception.PortalException, 564 com.liferay.portal.kernel.exception.SystemException; 565 566 /** 567 * Returns all the templates with the class PK. 568 * 569 * @param classPK the primary key of the template's related entity 570 * @return the templates with the class PK 571 * @throws SystemException if a system exception occurred 572 */ 573 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 574 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 575 long classPK) 576 throws com.liferay.portal.kernel.exception.SystemException; 577 578 /** 579 * Returns all the templates matching the group and class name ID. 580 * 581 * @param groupId the primary key of the group 582 * @param classNameId the primary key of the class name for the template's 583 related model 584 * @return the matching templates 585 * @throws SystemException if a system exception occurred 586 */ 587 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 588 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 589 long groupId, long classNameId) 590 throws com.liferay.portal.kernel.exception.SystemException; 591 592 /** 593 * Returns all the templates matching the group, class name ID, and class 594 * PK. 595 * 596 * @param groupId the primary key of the group 597 * @param classNameId the primary key of the class name for the template's 598 related model 599 * @param classPK the primary key of the template's related entity 600 * @return the matching templates 601 * @throws SystemException if a system exception occurred 602 */ 603 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 604 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 605 long groupId, long classNameId, long classPK) 606 throws com.liferay.portal.kernel.exception.SystemException; 607 608 /** 609 * Returns all the templates matching the group, class name ID, class PK, 610 * and type. 611 * 612 * @param groupId the primary key of the group 613 * @param classNameId the primary key of the class name for the template's 614 related model 615 * @param classPK the primary key of the template's related entity 616 * @param type the template's type. For more information, see {@link 617 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 618 * @return the matching templates 619 * @throws SystemException if a system exception occurred 620 */ 621 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 622 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 623 long groupId, long classNameId, long classPK, java.lang.String type) 624 throws com.liferay.portal.kernel.exception.SystemException; 625 626 /** 627 * Returns all the templates matching the group, class name ID, class PK, 628 * type, and mode. 629 * 630 * @param groupId the primary key of the group 631 * @param classNameId the primary key of the class name for the template's 632 related model 633 * @param classPK the primary key of the template's related entity 634 * @param type the template's type. For more information, see {@link 635 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 636 * @param mode the template's mode. For more information, see {@link 637 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 638 * @return the matching templates 639 * @throws SystemException if a system exception occurred 640 */ 641 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 642 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 643 long groupId, long classNameId, long classPK, java.lang.String type, 644 java.lang.String mode) 645 throws com.liferay.portal.kernel.exception.SystemException; 646 647 /** 648 * Returns all the templates matching the group and class PK. 649 * 650 * @param groupId the primary key of the group 651 * @param classPK the primary key of the template's related entity 652 * @return the matching templates 653 * @throws SystemException if a system exception occurred 654 */ 655 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 656 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 657 long groupId, long classPK) 658 throws com.liferay.portal.kernel.exception.SystemException; 659 660 /** 661 * Returns an ordered range of all the templates matching the group and 662 * structure class name ID. 663 * 664 * <p> 665 * Useful when paginating results. Returns a maximum of <code>end - 666 * start</code> instances. <code>start</code> and <code>end</code> are not 667 * primary keys, they are indexes in the result set. Thus, <code>0</code> 668 * refers to the first result in the set. Setting both <code>start</code> 669 * and <code>end</code> to {@link 670 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 671 * result set. 672 * </p> 673 * 674 * @param groupId the primary key of the group 675 * @param structureClassNameId the primary key of the class name for the 676 template's related structure 677 * @param start the lower bound of the range of templates to return 678 * @param end the upper bound of the range of templates to return (not 679 inclusive) 680 * @param orderByComparator the comparator to order the templates 681 (optionally <code>null</code>) 682 * @return the range of matching templates ordered by the comparator 683 * @throws SystemException if a system exception occurred 684 */ 685 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 686 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByStructureClassNameId( 687 long groupId, long structureClassNameId, int start, int end, 688 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 689 throws com.liferay.portal.kernel.exception.SystemException; 690 691 /** 692 * Returns the number of templates belonging to the group. 693 * 694 * @param groupId the primary key of the group 695 * @return the number of templates belonging to the group 696 * @throws SystemException if a system exception occurred 697 */ 698 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 699 public int getTemplatesCount(long groupId) 700 throws com.liferay.portal.kernel.exception.SystemException; 701 702 /** 703 * Returns the number of templates matching the group and class name ID. 704 * 705 * @param groupId the primary key of the group 706 * @param classNameId the primary key of the class name for the template's 707 related model 708 * @return the number of matching templates 709 * @throws SystemException if a system exception occurred 710 */ 711 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 712 public int getTemplatesCount(long groupId, long classNameId) 713 throws com.liferay.portal.kernel.exception.SystemException; 714 715 /** 716 * Returns an ordered range of all the templates matching the group, class 717 * name ID, class PK, type, and mode, and matching the keywords in the 718 * template names and descriptions. 719 * 720 * <p> 721 * Useful when paginating results. Returns a maximum of <code>end - 722 * start</code> instances. <code>start</code> and <code>end</code> are not 723 * primary keys, they are indexes in the result set. Thus, <code>0</code> 724 * refers to the first result in the set. Setting both <code>start</code> 725 * and <code>end</code> to {@link 726 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 727 * result set. 728 * </p> 729 * 730 * @param companyId the primary key of the template's company 731 * @param groupId the primary key of the group 732 * @param classNameId the primary key of the class name for the template's 733 related model 734 * @param classPK the primary key of the template's related entity 735 * @param keywords the keywords (space separated), which may occur in the 736 template's name or description (optionally <code>null</code>) 737 * @param type the template's type (optionally <code>null</code>). For more 738 information, see {@link 739 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 740 * @param mode the template's mode (optionally <code>null</code>). For more 741 information, see {@link 742 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 743 * @param start the lower bound of the range of templates to return 744 * @param end the upper bound of the range of templates to return (not 745 inclusive) 746 * @param orderByComparator the comparator to order the templates 747 (optionally <code>null</code>) 748 * @return the range of matching templates ordered by the comparator 749 * @throws SystemException if a system exception occurred 750 */ 751 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 752 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 753 long companyId, long groupId, long classNameId, long classPK, 754 java.lang.String keywords, java.lang.String type, 755 java.lang.String mode, int start, int end, 756 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 757 throws com.liferay.portal.kernel.exception.SystemException; 758 759 /** 760 * Returns an ordered range of all the templates matching the group, class 761 * name ID, class PK, name keyword, description keyword, type, mode, and 762 * language. 763 * 764 * <p> 765 * Useful when paginating results. Returns a maximum of <code>end - 766 * start</code> instances. <code>start</code> and <code>end</code> are not 767 * primary keys, they are indexes in the result set. Thus, <code>0</code> 768 * refers to the first result in the set. Setting both <code>start</code> 769 * and <code>end</code> to {@link 770 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 771 * result set. 772 * </p> 773 * 774 * @param companyId the primary key of the template's company 775 * @param groupId the primary key of the group 776 * @param classNameId the primary key of the class name for the template's 777 related model 778 * @param classPK the primary key of the template's related entity 779 * @param name the name keywords (optionally <code>null</code>) 780 * @param description the description keywords (optionally 781 <code>null</code>) 782 * @param type the template's type (optionally <code>null</code>). For more 783 information, see {@link 784 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 785 * @param mode the template's mode (optionally <code>null</code>). For more 786 information, see {@link 787 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 788 * @param language the template's script language (optionally 789 <code>null</code>). For more information, see {@link 790 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 791 * @param andOperator whether every field must match its keywords, or just 792 one field 793 * @param start the lower bound of the range of templates to return 794 * @param end the upper bound of the range of templates to return (not 795 inclusive) 796 * @param orderByComparator the comparator to order the templates 797 (optionally <code>null</code>) 798 * @return the range of matching templates ordered by the comparator 799 * @throws SystemException if a system exception occurred 800 */ 801 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 802 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 803 long companyId, long groupId, long classNameId, long classPK, 804 java.lang.String name, java.lang.String description, 805 java.lang.String type, java.lang.String mode, 806 java.lang.String language, boolean andOperator, int start, int end, 807 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 808 throws com.liferay.portal.kernel.exception.SystemException; 809 810 /** 811 * Returns an ordered range of all the templates matching the group IDs, 812 * class Name IDs, class PK, type, and mode, and include the keywords on its 813 * names and descriptions. 814 * 815 * <p> 816 * Useful when paginating results. Returns a maximum of <code>end - 817 * start</code> instances. <code>start</code> and <code>end</code> are not 818 * primary keys, they are indexes in the result set. Thus, <code>0</code> 819 * refers to the first result in the set. Setting both <code>start</code> 820 * and <code>end</code> to {@link 821 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 822 * result set. 823 * </p> 824 * 825 * @param companyId the primary key of the template's company 826 * @param groupIds the primary keys of the groups 827 * @param classNameIds the primary keys of the entity's instances the 828 templates are related to 829 * @param classPK the primary key of the template's related entity 830 * @param keywords the keywords (space separated), which may occur in the 831 template's name or description (optionally <code>null</code>) 832 * @param type the template's type (optionally <code>null</code>). For more 833 information, see {@link 834 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 835 * @param mode the template's mode (optionally <code>null</code>). For more 836 information, see {@link 837 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 838 * @param start the lower bound of the range of templates to return 839 * @param end the upper bound of the range of templates to return (not 840 inclusive) 841 * @param orderByComparator the comparator to order the templates 842 (optionally <code>null</code>) 843 * @return the range of matching templates ordered by the comparator 844 * @throws SystemException if a system exception occurred 845 */ 846 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 847 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 848 long companyId, long[] groupIds, long[] classNameIds, long classPK, 849 java.lang.String keywords, java.lang.String type, 850 java.lang.String mode, int start, int end, 851 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 852 throws com.liferay.portal.kernel.exception.SystemException; 853 854 /** 855 * Returns an ordered range of all the templates matching the group IDs, 856 * class name IDs, class PK, name keyword, description keyword, type, mode, 857 * and language. 858 * 859 * <p> 860 * Useful when paginating results. Returns a maximum of <code>end - 861 * start</code> instances. <code>start</code> and <code>end</code> are not 862 * primary keys, they are indexes in the result set. Thus, <code>0</code> 863 * refers to the first result in the set. Setting both <code>start</code> 864 * and <code>end</code> to {@link 865 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 866 * result set. 867 * </p> 868 * 869 * @param companyId the primary key of the template's company 870 * @param groupIds the primary keys of the groups 871 * @param classNameIds the primary keys of the entity's instances the 872 templates are related to 873 * @param classPK the primary key of the template's related entity 874 * @param name the name keywords (optionally <code>null</code>) 875 * @param description the description keywords (optionally 876 <code>null</code>) 877 * @param type the template's type (optionally <code>null</code>). For more 878 information, see {@link 879 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 880 * @param mode the template's mode (optionally <code>null</code>). For more 881 information, see {@link 882 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 883 * @param language the template's script language (optionally 884 <code>null</code>). For more information, see {@link 885 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 886 * @param andOperator whether every field must match its keywords, or just 887 one field. 888 * @param start the lower bound of the range of templates to return 889 * @param end the upper bound of the range of templates to return (not 890 inclusive) 891 * @param orderByComparator the comparator to order the templates 892 (optionally <code>null</code>) 893 * @return the range of matching templates ordered by the comparator 894 * @throws SystemException if a system exception occurred 895 */ 896 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 897 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 898 long companyId, long[] groupIds, long[] classNameIds, long classPK, 899 java.lang.String name, java.lang.String description, 900 java.lang.String type, java.lang.String mode, 901 java.lang.String language, boolean andOperator, int start, int end, 902 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 903 throws com.liferay.portal.kernel.exception.SystemException; 904 905 /** 906 * Returns the number of templates matching the group, class name ID, class 907 * PK, type, and matching the keywords in the template names and 908 * descriptions. 909 * 910 * @param companyId the primary key of the template's company 911 * @param groupId the primary key of the group 912 * @param classNameId the primary key of the class name for the template's 913 related model 914 * @param classPK the primary key of the template's related entity 915 * @param keywords the keywords (space separated), which may occur in the 916 template's name or description (optionally <code>null</code>) 917 * @param type the template's type (optionally <code>null</code>). For more 918 information, see {@link 919 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 920 * @param mode the template's mode (optionally <code>null</code>). For more 921 information, see {@link 922 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 923 * @return the number of matching templates 924 * @throws SystemException if a system exception occurred 925 */ 926 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 927 public int searchCount(long companyId, long groupId, long classNameId, 928 long classPK, java.lang.String keywords, java.lang.String type, 929 java.lang.String mode) 930 throws com.liferay.portal.kernel.exception.SystemException; 931 932 /** 933 * Returns the number of templates matching the group, class name ID, class 934 * PK, name keyword, description keyword, type, mode, and language. 935 * 936 * @param companyId the primary key of the template's company 937 * @param groupId the primary key of the group 938 * @param classNameId the primary key of the class name for the template's 939 related model 940 * @param classPK the primary key of the template's related entity 941 * @param name the name keywords (optionally <code>null</code>) 942 * @param description the description keywords (optionally 943 <code>null</code>) 944 * @param type the template's type (optionally <code>null</code>). For more 945 information, see {@link 946 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 947 * @param mode the template's mode (optionally <code>null</code>). For more 948 information, see {@link 949 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 950 * @param language the template's script language (optionally 951 <code>null</code>). For more information, see {@link 952 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 953 * @param andOperator whether every field must match its keywords, or just 954 one field. 955 * @return the number of matching templates 956 * @throws SystemException if a system exception occurred 957 */ 958 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 959 public int searchCount(long companyId, long groupId, long classNameId, 960 long classPK, java.lang.String name, java.lang.String description, 961 java.lang.String type, java.lang.String mode, 962 java.lang.String language, boolean andOperator) 963 throws com.liferay.portal.kernel.exception.SystemException; 964 965 /** 966 * Returns the number of templates matching the group IDs, class name IDs, 967 * class PK, type, and mode, and matching the keywords in the template names 968 * and descriptions. 969 * 970 * @param companyId the primary key of the template's company 971 * @param groupIds the primary keys of the groups 972 * @param classNameIds the primary keys of the entity's instance the 973 templates are related to 974 * @param classPK the primary key of the template's related entity 975 * @param keywords the keywords (space separated), which may occur in the 976 template's name or description (optionally <code>null</code>) 977 * @param type the template's type (optionally <code>null</code>). For more 978 information, see {@link 979 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 980 * @param mode the template's mode (optionally <code>null</code>). For more 981 information, see {@link 982 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 983 * @return the number of matching templates 984 * @throws SystemException if a system exception occurred 985 */ 986 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 987 public int searchCount(long companyId, long[] groupIds, 988 long[] classNameIds, long classPK, java.lang.String keywords, 989 java.lang.String type, java.lang.String mode) 990 throws com.liferay.portal.kernel.exception.SystemException; 991 992 /** 993 * Returns the number of templates matching the group IDs, class name IDs, 994 * class PKs, name keyword, description keyword, type, mode, and language. 995 * 996 * @param companyId the primary key of the templates company 997 * @param groupIds the primary keys of the groups 998 * @param classNameIds the primary keys of the entity's instance the 999 templates are related to 1000 * @param classPK the primary key of the template's related entity 1001 * @param name the name keywords (optionally <code>null</code>) 1002 * @param description the description keywords (optionally 1003 <code>null</code>) 1004 * @param type the template's type (optionally <code>null</code>). For more 1005 information, see {@link 1006 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1007 * @param mode the template's mode (optionally <code>null</code>). For more 1008 information, see {@link 1009 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1010 * @param language the template's script language (optionally 1011 <code>null</code>). For more information, see {@link 1012 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1013 * @param andOperator whether every field must match its keywords, or just 1014 one field. 1015 * @return the number of matching templates 1016 * @throws SystemException if a system exception occurred 1017 */ 1018 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1019 public int searchCount(long companyId, long[] groupIds, 1020 long[] classNameIds, long classPK, java.lang.String name, 1021 java.lang.String description, java.lang.String type, 1022 java.lang.String mode, java.lang.String language, boolean andOperator) 1023 throws com.liferay.portal.kernel.exception.SystemException; 1024 1025 /** 1026 * Updates the template matching the ID. 1027 * 1028 * @param templateId the primary key of the template 1029 * @param nameMap the template's new locales and localized names 1030 * @param descriptionMap the template's new locales and localized 1031 description 1032 * @param type the template's type. For more information, see {@link 1033 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1034 * @param mode the template's mode. For more information, see {@link 1035 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1036 * @param language the template's script language. For more information, 1037 see {@link 1038 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1039 * @param script the template's script 1040 * @param cacheable whether the template is cacheable 1041 * @param smallImage whether the template has a small image 1042 * @param smallImageURL the template's small image URL (optionally 1043 <code>null</code>) 1044 * @param smallImageFile the template's small image file (optionally 1045 <code>null</code>) 1046 * @param serviceContext the service context to be applied. Can set the 1047 modification date. 1048 * @return the updated template 1049 * @throws PortalException if a portal exception occurred 1050 * @throws SystemException if a system exception occurred 1051 */ 1052 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate( 1053 long templateId, 1054 java.util.Map<java.util.Locale, java.lang.String> nameMap, 1055 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1056 java.lang.String type, java.lang.String mode, 1057 java.lang.String language, java.lang.String script, boolean cacheable, 1058 boolean smallImage, java.lang.String smallImageURL, 1059 java.io.File smallImageFile, 1060 com.liferay.portal.service.ServiceContext serviceContext) 1061 throws com.liferay.portal.kernel.exception.PortalException, 1062 com.liferay.portal.kernel.exception.SystemException; 1063 }