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