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 DDMTemplate. 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 DDMTemplateServiceUtil 035 * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateServiceBaseImpl 036 * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl 037 * @generated 038 */ 039 @AccessControlled 040 @JSONWebService 041 @ProviderType 042 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 043 PortalException.class, SystemException.class}) 044 public interface DDMTemplateService extends BaseService { 045 /* 046 * NOTE FOR DEVELOPERS: 047 * 048 * Never modify or reference this interface directly. Always use {@link DDMTemplateServiceUtil} to access the d d m template remote service. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 049 */ 050 051 /** 052 * Adds a template. 053 * 054 * @param groupId the primary key of the group 055 * @param classNameId the primary key of the class name for template's 056 related model 057 * @param classPK the primary key of the template's related entity 058 * @param nameMap the template's locales and localized names 059 * @param descriptionMap the template's locales and localized descriptions 060 * @param type the template's type. For more information, see {@link 061 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 062 * @param mode the template's mode. For more information, see {@link 063 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 064 * @param language the template's script language. For more information, 065 see {@link 066 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 067 * @param script the template's script 068 * @param serviceContext the service context to be applied. Must have the 069 <code>ddmResource</code> attribute to check permissions. Can set 070 the UUID, creation date, modification date, guest permissions, 071 and group permissions for the template. 072 * @return the template 073 * @throws PortalException if the user did not have permission to add the 074 template or if a portal exception occurred 075 */ 076 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate( 077 long groupId, long classNameId, long classPK, 078 java.util.Map<java.util.Locale, java.lang.String> nameMap, 079 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 080 java.lang.String type, java.lang.String mode, 081 java.lang.String language, java.lang.String script, 082 com.liferay.portal.service.ServiceContext serviceContext) 083 throws com.liferay.portal.kernel.exception.PortalException; 084 085 /** 086 * Adds a template with additional parameters. 087 * 088 * @param groupId the primary key of the group 089 * @param classNameId the primary key of the class name for template's 090 related model 091 * @param classPK the primary key of the template's related entity 092 * @param templateKey the unique string identifying the template 093 (optionally <code>null</code>) 094 * @param nameMap the template's locales and localized names 095 * @param descriptionMap the template's locales and localized descriptions 096 * @param type the template's type. For more information, see {@link 097 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 098 * @param mode the template's mode. For more information, see {@link 099 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 100 * @param language the template's script language. For more information, 101 see {@link 102 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 103 * @param script the template's script 104 * @param cacheable whether the template is cacheable 105 * @param smallImage whether the template has a small image 106 * @param smallImageURL the template's small image URL (optionally 107 <code>null</code>) 108 * @param smallImageFile the template's small image file (optionally 109 <code>null</code>) 110 * @param serviceContext the service context to be applied. Must have the 111 <code>ddmResource</code> attribute to check permissions. Can set 112 the UUID, creation date, modification date, guest permissions, 113 and group permissions for the template. 114 * @return the template 115 * @throws PortalException if the user did not have permission to add the 116 template or if a portal exception occurred 117 */ 118 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate( 119 long groupId, long classNameId, long classPK, 120 java.lang.String templateKey, 121 java.util.Map<java.util.Locale, java.lang.String> nameMap, 122 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 123 java.lang.String type, java.lang.String mode, 124 java.lang.String language, java.lang.String script, boolean cacheable, 125 boolean smallImage, java.lang.String smallImageURL, 126 java.io.File smallImageFile, 127 com.liferay.portal.service.ServiceContext serviceContext) 128 throws com.liferay.portal.kernel.exception.PortalException; 129 130 /** 131 * Copies the template, creating a new template with all the values 132 * extracted from the original one. This method supports defining a new name 133 * and description. 134 * 135 * @param templateId the primary key of the template to be copied 136 * @param nameMap the new template's locales and localized names 137 * @param descriptionMap the new template's locales and localized 138 descriptions 139 * @param serviceContext the service context to be applied. Must have the 140 <code>ddmResource</code> attribute to check permissions. Can set 141 the UUID, creation date, modification date, guest permissions, 142 and group permissions for the template. 143 * @return the new template 144 * @throws PortalException if the user did not have permission to add the 145 template or if a portal exception occurred 146 */ 147 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate( 148 long templateId, 149 java.util.Map<java.util.Locale, java.lang.String> nameMap, 150 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 151 com.liferay.portal.service.ServiceContext serviceContext) 152 throws com.liferay.portal.kernel.exception.PortalException; 153 154 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate( 155 long templateId, 156 com.liferay.portal.service.ServiceContext serviceContext) 157 throws com.liferay.portal.kernel.exception.PortalException; 158 159 /** 160 * Copies all the templates matching the class name ID, class PK, and type. 161 * This method creates new templates, extracting all the values from the old 162 * ones and updating their class PKs. 163 * 164 * @param classNameId the primary key of the class name for template's 165 related model 166 * @param classPK the primary key of the original template's related entity 167 * @param newClassPK the primary key of the new template's related entity 168 * @param type the template's type. For more information, see {@link 169 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 170 * @param serviceContext the service context to be applied. Must have the 171 <code>ddmResource</code> attribute to check permissions. Can set 172 the UUID, creation date, modification date, guest permissions, 173 and group permissions for the template. 174 * @return the new template 175 * @throws PortalException if the user did not have permission to add the 176 template or if a portal exception occurred 177 */ 178 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> copyTemplates( 179 long classNameId, long classPK, long newClassPK, java.lang.String type, 180 com.liferay.portal.service.ServiceContext serviceContext) 181 throws com.liferay.portal.kernel.exception.PortalException; 182 183 /** 184 * Deletes the template and its resources. 185 * 186 * @param templateId the primary key of the template to be deleted 187 * @throws PortalException if the user did not have permission to delete the 188 template or if a portal exception occurred 189 */ 190 public void deleteTemplate(long templateId) 191 throws com.liferay.portal.kernel.exception.PortalException; 192 193 /** 194 * Returns the template matching the group and template key. 195 * 196 * @param groupId the primary key of the group 197 * @param classNameId the primary key of the class name for template's 198 related model 199 * @param templateKey the unique string identifying the template 200 * @return the matching template, or <code>null</code> if a matching 201 template could not be found 202 * @throws PortalException if the user did not have permission to view the 203 template 204 */ 205 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 206 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 207 long groupId, long classNameId, java.lang.String templateKey) 208 throws com.liferay.portal.kernel.exception.PortalException; 209 210 /** 211 * Returns the Spring bean ID for this bean. 212 * 213 * @return the Spring bean ID for this bean 214 */ 215 public java.lang.String getBeanIdentifier(); 216 217 /** 218 * Returns the template matching the group and template key. 219 * 220 * @param groupId the primary key of the group 221 * @param classNameId the primary key of the class name for template's 222 related model 223 * @param templateKey the unique string identifying the template 224 * @return the matching template 225 * @throws PortalException if a matching template could not be found 226 */ 227 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 228 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 229 long groupId, long classNameId, java.lang.String templateKey) 230 throws com.liferay.portal.kernel.exception.PortalException; 231 232 /** 233 * Returns the template matching the group and template key, optionally 234 * searching ancestor sites (that have sharing enabled) and global scoped 235 * sites. 236 * 237 * <p> 238 * This method first searches in the group. If the template is still not 239 * found and <code>includeAncestorTemplates</code> is set to 240 * <code>true</code>, this method searches the group's ancestor sites (that 241 * have sharing enabled) and lastly searches global scoped sites. 242 * </p> 243 * 244 * @param groupId the primary key of the group 245 * @param classNameId the primary key of the class name for template's 246 related model 247 * @param templateKey the unique string identifying the template 248 * @param includeAncestorTemplates whether to include ancestor sites (that 249 have sharing enabled) and include global scoped sites in the 250 search 251 * @return the matching template 252 * @throws PortalException if a matching template could not be found 253 */ 254 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 255 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 256 long groupId, long classNameId, java.lang.String templateKey, 257 boolean includeAncestorTemplates) 258 throws com.liferay.portal.kernel.exception.PortalException; 259 260 /** 261 * Returns the template with the ID. 262 * 263 * @param templateId the primary key of the template 264 * @return the template with the ID 265 * @throws PortalException if the user did not have permission to view the 266 template or if a matching template could not be found 267 */ 268 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 269 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 270 long templateId) 271 throws com.liferay.portal.kernel.exception.PortalException; 272 273 /** 274 * Returns all the templates matching the group and class name ID. 275 * 276 * @param groupId the primary key of the group 277 * @param classNameId the primary key of the class name for template's 278 related model 279 * @return the matching templates 280 */ 281 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 282 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 283 long groupId, long classNameId); 284 285 /** 286 * Returns all the templates matching the group, class name ID, and class 287 * PK. 288 * 289 * @param groupId the primary key of the group 290 * @param classNameId the primary key of the class name for template's 291 related model 292 * @param classPK the primary key of the template's related entity 293 * @return the matching templates 294 */ 295 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 296 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 297 long groupId, long classNameId, long classPK); 298 299 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 300 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 301 long groupId, long classNameId, long classPK, 302 boolean includeAncestorTemplates) 303 throws com.liferay.portal.kernel.exception.PortalException; 304 305 /** 306 * Returns all the templates matching the class name ID, class PK, type, and 307 * mode. 308 * 309 * @param groupId the primary key of the group 310 * @param classNameId the primary key of the class name for template's 311 related model 312 * @param classPK the primary key of the template's related entity 313 * @param type the template's type. For more information, see {@link 314 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 315 * @return the matching templates 316 */ 317 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 318 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 319 long groupId, long classNameId, long classPK, java.lang.String type); 320 321 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 322 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 323 long groupId, long classNameId, long classPK, java.lang.String type, 324 java.lang.String mode); 325 326 /** 327 * Returns all the templates matching the group and class PK. 328 * 329 * @param groupId the primary key of the group 330 * @param classPK the primary key of the template's related entity 331 * @return the matching templates 332 */ 333 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 334 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 335 long groupId, long classPK); 336 337 /** 338 * Returns an ordered range of all the templates matching the group and 339 * structure class name ID and all the generic templates matching the group. 340 * 341 * <p> 342 * Useful when paginating results. Returns a maximum of <code>end - 343 * start</code> instances. <code>start</code> and <code>end</code> are not 344 * primary keys, they are indexes in the result set. Thus, <code>0</code> 345 * refers to the first result in the set. Setting both <code>start</code> 346 * and <code>end</code> to {@link 347 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 348 * result set. 349 * </p> 350 * 351 * @param groupId the primary key of the group 352 * @param structureClassNameId the primary key of the class name for the 353 template's related structure (optionally <code>0</code>). Specify 354 <code>0</code> to return generic templates only. 355 * @param start the lower bound of the range of templates to return 356 * @param end the upper bound of the range of templates to return (not 357 inclusive) 358 * @param orderByComparator the comparator to order the templates 359 (optionally <code>null</code>) 360 * @return the range of matching templates ordered by the comparator 361 */ 362 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 363 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByStructureClassNameId( 364 long groupId, long structureClassNameId, int start, int end, 365 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator); 366 367 /** 368 * Returns the number of templates matching the group and structure class 369 * name ID plus the number of generic templates matching the group. 370 * 371 * @param groupId the primary key of the group 372 * @param structureClassNameId the primary key of the class name for the 373 template's related structure (optionally <code>0</code>). Specify 374 <code>0</code> to count generic templates only. 375 * @return the number of matching templates plus the number of matching 376 generic templates 377 */ 378 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 379 public int getTemplatesByStructureClassNameIdCount(long groupId, 380 long structureClassNameId); 381 382 /** 383 * Returns an ordered range of all the templates matching the group, class 384 * name ID, class PK, type, and mode, and matching the keywords in the 385 * template names and descriptions. 386 * 387 * <p> 388 * Useful when paginating results. Returns a maximum of <code>end - 389 * start</code> instances. <code>start</code> and <code>end</code> are not 390 * primary keys, they are indexes in the result set. Thus, <code>0</code> 391 * refers to the first result in the set. Setting both <code>start</code> 392 * and <code>end</code> to {@link 393 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 394 * result set. 395 * </p> 396 * 397 * @param companyId the primary key of the template's company 398 * @param groupId the primary key of the group 399 * @param classNameId the primary key of the class name for template's 400 related model 401 * @param classPK the primary key of the template's related entity 402 * @param keywords the keywords (space separated), which may occur in the 403 template's name or description (optionally <code>null</code>) 404 * @param type the template's type (optionally <code>null</code>). For more 405 information, see {@link 406 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 407 * @param mode the template's mode (optionally <code>null</code>) For more 408 information, see {@link 409 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 410 * @param start the lower bound of the range of templates to return 411 * @param end the upper bound of the range of templates to return (not 412 inclusive) 413 * @param orderByComparator the comparator to order the templates 414 (optionally <code>null</code>) 415 * @return the matching templates ordered by the comparator 416 */ 417 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 418 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 419 long companyId, long groupId, long classNameId, long classPK, 420 java.lang.String keywords, java.lang.String type, 421 java.lang.String mode, int start, int end, 422 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator); 423 424 /** 425 * Returns an ordered range of all the templates matching the group, class 426 * name ID, class PK, name keyword, description keyword, type, mode, and 427 * language. 428 * 429 * <p> 430 * Useful when paginating results. Returns a maximum of <code>end - 431 * start</code> instances. <code>start</code> and <code>end</code> are not 432 * primary keys, they are indexes in the result set. Thus, <code>0</code> 433 * refers to the first result in the set. Setting both <code>start</code> 434 * and <code>end</code> to {@link 435 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 436 * result set. 437 * </p> 438 * 439 * @param companyId the primary key of the template's company 440 * @param groupId the primary key of the group 441 * @param classNameId the primary key of the class name for template's 442 related model 443 * @param classPK the primary key of the template's related entity 444 * @param name the name keywords (optionally <code>null</code>) 445 * @param description the description keywords (optionally 446 <code>null</code>) 447 * @param type the template's type (optionally <code>null</code>). For more 448 information, see {@link 449 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 450 * @param mode the template's mode (optionally <code>null</code>). For more 451 information, see {@link 452 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 453 * @param language the template's script language (optionally 454 <code>null</code>). For more information, see {@link 455 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 456 * @param andOperator whether every field must match its keywords, or just 457 one field. 458 * @param start the lower bound of the range of templates to return 459 * @param end the upper bound of the range of templates to return (not 460 inclusive) 461 * @param orderByComparator the comparator to order the templates 462 (optionally <code>null</code>) 463 * @return the matching templates ordered by the comparator 464 */ 465 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 466 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 467 long companyId, long groupId, long classNameId, long classPK, 468 java.lang.String name, java.lang.String description, 469 java.lang.String type, java.lang.String mode, 470 java.lang.String language, boolean andOperator, int start, int end, 471 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator); 472 473 /** 474 * Returns an ordered range of all the templates matching the group IDs, 475 * class name IDs, class PK, type, and mode, and matching the keywords in 476 * the template names and descriptions. 477 * 478 * <p> 479 * Useful when paginating results. Returns a maximum of <code>end - 480 * start</code> instances. <code>start</code> and <code>end</code> are not 481 * primary keys, they are indexes in the result set. Thus, <code>0</code> 482 * refers to the first result in the set. Setting both <code>start</code> 483 * and <code>end</code> to {@link 484 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 485 * result set. 486 * </p> 487 * 488 * @param companyId the primary key of the template's company 489 * @param groupIds the primary keys of the groups 490 * @param classNameIds the primary keys of the entity's instances the 491 templates are related to 492 * @param classPKs the primary keys of the template's related entities 493 * @param keywords the keywords (space separated), which may occur in the 494 template's name or description (optionally <code>null</code>) 495 * @param type the template's type (optionally <code>null</code>). For more 496 information, see {@link 497 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 498 * @param mode the template's mode (optionally <code>null</code>). For more 499 information, see {@link 500 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 501 * @param start the lower bound of the range of templates to return 502 * @param end the upper bound of the range of templates to return (not 503 inclusive) 504 * @param orderByComparator the comparator to order the templates 505 (optionally <code>null</code>) 506 * @return the matching templates ordered by the comparator 507 */ 508 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 509 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 510 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 511 java.lang.String keywords, java.lang.String type, 512 java.lang.String mode, int start, int end, 513 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator); 514 515 /** 516 * Returns an ordered range of all the templates matching the group IDs, 517 * class name IDs, class PK, name keyword, description keyword, type, mode, 518 * and language. 519 * 520 * <p> 521 * Useful when paginating results. Returns a maximum of <code>end - 522 * start</code> instances. <code>start</code> and <code>end</code> are not 523 * primary keys, they are indexes in the result set. Thus, <code>0</code> 524 * refers to the first result in the set. Setting both <code>start</code> 525 * and <code>end</code> to {@link 526 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 527 * result set. 528 * </p> 529 * 530 * @param companyId the primary key of the template's company 531 * @param groupIds the primary keys of the groups 532 * @param classNameIds the primary keys of the entity's instances the 533 templates are related to 534 * @param classPKs the primary keys of the template's related entities 535 * @param name the name keywords (optionally <code>null</code>) 536 * @param description the description keywords (optionally 537 <code>null</code>) 538 * @param type the template's type (optionally <code>null</code>). For more 539 information, see {@link 540 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 541 * @param mode the template's mode (optionally <code>null</code>). For more 542 information, see {@link 543 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 544 * @param language the template's script language (optionally 545 <code>null</code>). For more information, see {@link 546 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 547 * @param andOperator whether every field must match its keywords, or just 548 one field. 549 * @param start the lower bound of the range of templates to return 550 * @param end the upper bound of the range of templates to return (not 551 inclusive) 552 * @param orderByComparator the comparator to order the templates 553 (optionally <code>null</code>) 554 * @return the matching templates ordered by the comparator 555 */ 556 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 557 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 558 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 559 java.lang.String name, java.lang.String description, 560 java.lang.String type, java.lang.String mode, 561 java.lang.String language, boolean andOperator, int start, int end, 562 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator); 563 564 /** 565 * Returns the number of templates matching the group, class name ID, class 566 * PK, type, and mode, and matching the keywords in the template names and 567 * descriptions. 568 * 569 * @param companyId the primary key of the template's company 570 * @param groupId the primary key of the group 571 * @param classNameId the primary key of the class name for template's 572 related model 573 * @param classPK the primary key of the template's related entity 574 * @param keywords the keywords (space separated), which may occur in the 575 template's name or description (optionally <code>null</code>) 576 * @param type the template's type (optionally <code>null</code>). For more 577 information, see {@link 578 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 579 * @param mode the template's mode (optionally <code>null</code>). For more 580 information, see {@link 581 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 582 * @return the number of matching templates 583 */ 584 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 585 public int searchCount(long companyId, long groupId, long classNameId, 586 long classPK, java.lang.String keywords, java.lang.String type, 587 java.lang.String mode); 588 589 /** 590 * Returns the number of templates matching the group, class name ID, class 591 * PK, name keyword, description keyword, type, mode, and language. 592 * 593 * @param companyId the primary key of the template's company 594 * @param groupId the primary key of the group 595 * @param classNameId the primary key of the class name for template's 596 related model 597 * @param classPK the primary key of the template's related entity 598 * @param name the name keywords (optionally <code>null</code>) 599 * @param description the description keywords (optionally 600 <code>null</code>) 601 * @param type the template's type (optionally <code>null</code>). For more 602 information, see {@link 603 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 604 * @param mode the template's mode (optionally <code>null</code>). For more 605 information, see {@link 606 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 607 * @param language the template's script language (optionally 608 <code>null</code>). For more information, see {@link 609 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 610 * @param andOperator whether every field must match its keywords, or just 611 one field. 612 * @return the number of matching templates 613 */ 614 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 615 public int searchCount(long companyId, long groupId, long classNameId, 616 long classPK, java.lang.String name, java.lang.String description, 617 java.lang.String type, java.lang.String mode, 618 java.lang.String language, boolean andOperator); 619 620 /** 621 * Returns the number of templates matching the group IDs, class name IDs, 622 * class PK, type, and mode, and matching the keywords in the template names 623 * and descriptions. 624 * 625 * @param companyId the primary key of the template's company 626 * @param groupIds the primary keys of the groups 627 * @param classNameIds the primary keys of the entity's instances the 628 templates are related to 629 * @param classPKs the primary keys of the template's related entities 630 * @param keywords the keywords (space separated), which may occur in the 631 template's name or description (optionally <code>null</code>) 632 * @param type the template's type (optionally <code>null</code>). For more 633 information, see {@link 634 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 635 * @param mode the template's mode (optionally <code>null</code>). For more 636 information, see {@link 637 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 638 * @return the number of matching templates 639 */ 640 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 641 public int searchCount(long companyId, long[] groupIds, 642 long[] classNameIds, long[] classPKs, java.lang.String keywords, 643 java.lang.String type, java.lang.String mode); 644 645 /** 646 * Returns the number of templates matching the group IDs, class name IDs, 647 * class PK, name keyword, description keyword, type, mode, and language. 648 * 649 * @param companyId the primary key of the template's company 650 * @param groupIds the primary keys of the groups 651 * @param classNameIds the primary keys of the entity's instances the 652 templates are related to 653 * @param classPKs the primary keys of the template's related entities 654 * @param name the name keywords (optionally <code>null</code>) 655 * @param description the description keywords (optionally 656 <code>null</code>) 657 * @param type the template's type (optionally <code>null</code>). For more 658 information, see {@link 659 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 660 * @param mode the template's mode (optionally <code>null</code>). For more 661 information, see {@link 662 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 663 * @param language the template's script language (optionally 664 <code>null</code>). For more information, see {@link 665 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 666 * @param andOperator whether every field must match its keywords, or just 667 one field. 668 * @return the number of matching templates 669 */ 670 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 671 public int searchCount(long companyId, long[] groupIds, 672 long[] classNameIds, long[] classPKs, java.lang.String name, 673 java.lang.String description, java.lang.String type, 674 java.lang.String mode, java.lang.String language, boolean andOperator); 675 676 /** 677 * Sets the Spring bean ID for this bean. 678 * 679 * @param beanIdentifier the Spring bean ID for this bean 680 */ 681 public void setBeanIdentifier(java.lang.String beanIdentifier); 682 683 /** 684 * Updates the template matching the ID. 685 * 686 * @param templateId the primary key of the template 687 * @param classPK the primary key of the template's related entity 688 * @param nameMap the template's new locales and localized names 689 * @param descriptionMap the template's new locales and localized 690 description 691 * @param type the template's type. For more information, see {@link 692 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 693 * @param mode the template's mode. For more information, see {@link 694 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 695 * @param language the template's script language. For more information, 696 see {@link 697 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 698 * @param script the template's script 699 * @param cacheable whether the template is cacheable 700 * @param serviceContext the service context to be applied. Can set the 701 modification date. 702 * @return the updated template 703 * @throws PortalException if the user did not have permission to update the 704 template or if a portal exception occurred 705 */ 706 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate( 707 long templateId, long classPK, 708 java.util.Map<java.util.Locale, java.lang.String> nameMap, 709 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 710 java.lang.String type, java.lang.String mode, 711 java.lang.String language, java.lang.String script, boolean cacheable, 712 com.liferay.portal.service.ServiceContext serviceContext) 713 throws com.liferay.portal.kernel.exception.PortalException; 714 715 /** 716 * Updates the template matching the ID. 717 * 718 * @param templateId the primary key of the template 719 * @param classPK the primary key of the template's related entity 720 * @param nameMap the template's new locales and localized names 721 * @param descriptionMap the template's new locales and localized 722 description 723 * @param type the template's type. For more information, see {@link 724 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 725 * @param mode the template's mode. For more information, see {@link 726 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 727 * @param language the template's script language. For more information, 728 see {@link 729 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 730 * @param script the template's script 731 * @param cacheable whether the template is cacheable 732 * @param smallImage whether the template has a small image 733 * @param smallImageURL the template's small image URL (optionally 734 <code>null</code>) 735 * @param smallImageFile the template's small image file (optionally 736 <code>null</code>) 737 * @param serviceContext the service context to be applied. Can set the 738 modification date. 739 * @return the updated template 740 * @throws PortalException if the user did not have permission to update the 741 template or if a portal exception occurred 742 */ 743 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate( 744 long templateId, long classPK, 745 java.util.Map<java.util.Locale, java.lang.String> nameMap, 746 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 747 java.lang.String type, java.lang.String mode, 748 java.lang.String language, java.lang.String script, boolean cacheable, 749 boolean smallImage, java.lang.String smallImageURL, 750 java.io.File smallImageFile, 751 com.liferay.portal.service.ServiceContext serviceContext) 752 throws com.liferay.portal.kernel.exception.PortalException; 753 }