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