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