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