001 /** 002 * Copyright (c) 2000-2012 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 template's service context. 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 template's service context. 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 delete 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 an ordered range of all the templates matching the group, class 351 * name ID, class PK, type, and mode, and matching the keywords in the 352 * template names and descriptions. 353 * 354 * <p> 355 * Useful when paginating results. Returns a maximum of <code>end - 356 * start</code> instances. <code>start</code> and <code>end</code> are not 357 * primary keys, they are indexes in the result set. Thus, <code>0</code> 358 * refers to the first result in the set. Setting both <code>start</code> 359 * and <code>end</code> to {@link 360 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 361 * result set. 362 * </p> 363 * 364 * @param companyId the primary key of the template's company 365 * @param groupId the primary key of the group 366 * @param classNameId the primary key of the class name for template's 367 related model 368 * @param classPK the primary key of the template's related entity 369 * @param keywords the keywords (space separated), which may occur in the 370 template's name or description (optionally <code>null</code>) 371 * @param type the template's type (optionally <code>null</code>). For more 372 information, see {@link 373 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 374 * @param mode the template's mode (optionally <code>null</code>) For more 375 information, see {@link 376 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 377 * @param start the lower bound of the range of templates to return 378 * @param end the upper bound of the range of templates to return (not 379 inclusive) 380 * @param orderByComparator the comparator to order the templates 381 (optionally <code>null</code>) 382 * @return the matching templates ordered by the comparator 383 * @throws SystemException if a system exception occurred 384 */ 385 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 386 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 387 long companyId, long groupId, long classNameId, long classPK, 388 java.lang.String keywords, java.lang.String type, 389 java.lang.String mode, 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, name keyword, description keyword, type, mode, and 396 * language. 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 name the name keywords (optionally <code>null</code>) 414 * @param description the description keywords (optionally 415 <code>null</code>) 416 * @param type the template's type (optionally <code>null</code>). For more 417 information, see {@link 418 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 419 * @param mode the template's mode (optionally <code>null</code>). For more 420 information, see {@link 421 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 422 * @param language the template's script language (optionally 423 <code>null</code>). For more information, see {@link 424 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 425 * @param andOperator whether every field must match its keywords, or just 426 one field. 427 * @param start the lower bound of the range of templates to return 428 * @param end the upper bound of the range of templates to return (not 429 inclusive) 430 * @param orderByComparator the comparator to order the templates 431 (optionally <code>null</code>) 432 * @return the matching templates ordered by the comparator 433 * @throws SystemException if a system exception occurred 434 */ 435 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 436 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 437 long companyId, long groupId, long classNameId, long classPK, 438 java.lang.String name, java.lang.String description, 439 java.lang.String type, java.lang.String mode, 440 java.lang.String language, boolean andOperator, int start, int end, 441 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 442 throws com.liferay.portal.kernel.exception.SystemException; 443 444 /** 445 * Returns an ordered range of all the templates matching the group IDs, 446 * class name IDs, class PK, type, and mode, and matching the keywords in 447 * the template names and descriptions. 448 * 449 * <p> 450 * Useful when paginating results. Returns a maximum of <code>end - 451 * start</code> instances. <code>start</code> and <code>end</code> are not 452 * primary keys, they are indexes in the result set. Thus, <code>0</code> 453 * refers to the first result in the set. Setting both <code>start</code> 454 * and <code>end</code> to {@link 455 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 456 * result set. 457 * </p> 458 * 459 * @param companyId the primary key of the template's company 460 * @param groupIds the primary keys of the groups 461 * @param classNameIds the primary keys of the entity's instances the 462 templates are related to 463 * @param classPK the primary key of the template's related entity 464 * @param keywords the keywords (space separated), which may occur in the 465 template's name or description (optionally <code>null</code>) 466 * @param type the template's type (optionally <code>null</code>). For more 467 information, see {@link 468 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 469 * @param mode the template's mode (optionally <code>null</code>). For more 470 information, see {@link 471 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 472 * @param start the lower bound of the range of templates to return 473 * @param end the upper bound of the range of templates to return (not 474 inclusive) 475 * @param orderByComparator the comparator to order the templates 476 (optionally <code>null</code>) 477 * @return the matching templates ordered by the comparator 478 * @throws SystemException if a system exception occurred 479 */ 480 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 481 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 482 long companyId, long[] groupIds, long[] classNameIds, long classPK, 483 java.lang.String keywords, java.lang.String type, 484 java.lang.String mode, 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, name keyword, description keyword, type, mode, 491 * and language. 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 name the name keywords (optionally <code>null</code>) 509 * @param description the description keywords (optionally 510 <code>null</code>) 511 * @param type the template's type (optionally <code>null</code>). For more 512 information, see {@link 513 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 514 * @param mode the template's mode (optionally <code>null</code>). For more 515 information, see {@link 516 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 517 * @param language the template's script language (optionally 518 <code>null</code>). For more information, see {@link 519 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 520 * @param andOperator whether every field must match its keywords, or just 521 one field. 522 * @param start the lower bound of the range of templates to return 523 * @param end the upper bound of the range of templates to return (not 524 inclusive) 525 * @param orderByComparator the comparator to order the templates 526 (optionally <code>null</code>) 527 * @return the matching templates ordered by the comparator 528 * @throws SystemException if a system exception occurred 529 */ 530 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 531 public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 532 long companyId, long[] groupIds, long[] classNameIds, long classPK, 533 java.lang.String name, java.lang.String description, 534 java.lang.String type, java.lang.String mode, 535 java.lang.String language, boolean andOperator, int start, int end, 536 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 537 throws com.liferay.portal.kernel.exception.SystemException; 538 539 /** 540 * Returns the number of templates matching the group, class name ID, class 541 * PK, type, and mode, and matching the keywords in the template names and 542 * descriptions. 543 * 544 * @param companyId the primary key of the template's company 545 * @param groupId the primary key of the group 546 * @param classNameId the primary key of the class name for template's 547 related model 548 * @param classPK the primary key of the template's related entity 549 * @param keywords the keywords (space separated), which may occur in the 550 template's name or description (optionally <code>null</code>) 551 * @param type the template's type (optionally <code>null</code>). For more 552 information, see {@link 553 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 554 * @param mode the template's mode (optionally <code>null</code>). For more 555 information, see {@link 556 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 557 * @return the number of matching templates 558 * @throws SystemException if a system exception occurred 559 */ 560 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 561 public int searchCount(long companyId, long groupId, long classNameId, 562 long classPK, java.lang.String keywords, java.lang.String type, 563 java.lang.String mode) 564 throws com.liferay.portal.kernel.exception.SystemException; 565 566 /** 567 * Returns the number of templates matching the group, class name ID, class 568 * PK, name keyword, description keyword, type, mode, and language. 569 * 570 * @param companyId the primary key of the template's company 571 * @param groupId the primary key of the group 572 * @param classNameId the primary key of the class name for template's 573 related model 574 * @param classPK the primary key of the template's related entity 575 * @param name the name keywords (optionally <code>null</code>) 576 * @param description the description keywords (optionally 577 <code>null</code>) 578 * @param type the template's type (optionally <code>null</code>). For more 579 information, see {@link 580 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 581 * @param mode the template's mode (optionally <code>null</code>). For more 582 information, see {@link 583 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 584 * @param language the template's script language (optionally 585 <code>null</code>). For more information, see {@link 586 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 587 * @param andOperator whether every field must match its keywords, or just 588 one field. 589 * @return the number of matching templates 590 * @throws SystemException if a system exception occurred 591 */ 592 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 593 public int searchCount(long companyId, long groupId, long classNameId, 594 long classPK, java.lang.String name, java.lang.String description, 595 java.lang.String type, java.lang.String mode, 596 java.lang.String language, boolean andOperator) 597 throws com.liferay.portal.kernel.exception.SystemException; 598 599 /** 600 * Returns the number of templates matching the group IDs, class name IDs, 601 * class PK, type, and mode, and matching the keywords in the template names 602 * and descriptions. 603 * 604 * @param companyId the primary key of the template's company 605 * @param groupIds the primary keys of the groups 606 * @param classNameIds the primary keys of the entity's instances the 607 templates are related to 608 * @param classPK the primary key of the template's related entity 609 * @param keywords the keywords (space separated), which may occur in the 610 template's name or description (optionally <code>null</code>) 611 * @param type the template's type (optionally <code>null</code>). For more 612 information, see {@link 613 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 614 * @param mode the template's mode (optionally <code>null</code>). For more 615 information, see {@link 616 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 617 * @return the number of matching templates 618 * @throws SystemException if a system exception occurred 619 */ 620 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 621 public int searchCount(long companyId, long[] groupIds, 622 long[] classNameIds, long classPK, java.lang.String keywords, 623 java.lang.String type, java.lang.String mode) 624 throws com.liferay.portal.kernel.exception.SystemException; 625 626 /** 627 * Returns the number of templates matching the group IDs, class name IDs, 628 * class PK, name keyword, description keyword, type, mode, and language. 629 * 630 * @param companyId the primary key of the template's company 631 * @param groupIds the primary keys of the groups 632 * @param classNameIds the primary keys of the entity's instances the 633 templates are related to 634 * @param classPK the primary key of the template's related entity 635 * @param name the name keywords (optionally <code>null</code>) 636 * @param description the description keywords (optionally 637 <code>null</code>) 638 * @param type the template's type (optionally <code>null</code>). For more 639 information, see {@link 640 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 641 * @param mode the template's mode (optionally <code>null</code>). For more 642 information, see {@link 643 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 644 * @param language the template's script language (optionally 645 <code>null</code>). For more information, see {@link 646 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 647 * @param andOperator whether every field must match its keywords, or just 648 one field. 649 * @return the number of matching templates 650 * @throws SystemException if a system exception occurred 651 */ 652 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 653 public int searchCount(long companyId, long[] groupIds, 654 long[] classNameIds, long classPK, java.lang.String name, 655 java.lang.String description, java.lang.String type, 656 java.lang.String mode, java.lang.String language, boolean andOperator) 657 throws com.liferay.portal.kernel.exception.SystemException; 658 659 /** 660 * Updates the template matching the ID. 661 * 662 * @param templateId the primary key of the template 663 * @param nameMap the template's new locales and localized names 664 * @param descriptionMap the template's new locales and localized 665 description 666 * @param type the template's type. For more information, see {@link 667 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 668 * @param mode the template's mode. For more information, see {@link 669 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 670 * @param language the template's script language. For more information, 671 see {@link 672 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 673 * @param script the template's script 674 * @param cacheable whether the template is cacheable 675 * @param smallImage whether the template has a small image 676 * @param smallImageURL the template's small image URL (optionally 677 <code>null</code>) 678 * @param smallImageFile the template's small image file (optionally 679 <code>null</code>) 680 * @param serviceContext the service context to be applied. Can set the 681 modification date. 682 * @return the updated template 683 * @throws PortalException if the user did not have permission to update the 684 template or if a portal exception occurred 685 * @throws SystemException if a system exception occurred 686 */ 687 public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate( 688 long templateId, 689 java.util.Map<java.util.Locale, java.lang.String> nameMap, 690 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 691 java.lang.String type, java.lang.String mode, 692 java.lang.String language, java.lang.String script, boolean cacheable, 693 boolean smallImage, java.lang.String smallImageURL, 694 java.io.File smallImageFile, 695 com.liferay.portal.service.ServiceContext serviceContext) 696 throws com.liferay.portal.kernel.exception.PortalException, 697 com.liferay.portal.kernel.exception.SystemException; 698 }