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 local service utility for DDMTemplate. This utility wraps 024 * {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see DDMTemplateLocalService 032 * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateLocalServiceBaseImpl 033 * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class DDMTemplateLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the d d m template to the database. Also notifies the appropriate model listeners. 046 * 047 * @param ddmTemplate the d d m template 048 * @return the d d m template that was added 049 * @throws SystemException if a system exception occurred 050 */ 051 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addDDMTemplate( 052 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) 053 throws com.liferay.portal.kernel.exception.SystemException { 054 return getService().addDDMTemplate(ddmTemplate); 055 } 056 057 /** 058 * Creates a new d d m template with the primary key. Does not add the d d m template to the database. 059 * 060 * @param templateId the primary key for the new d d m template 061 * @return the new d d m template 062 */ 063 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate createDDMTemplate( 064 long templateId) { 065 return getService().createDDMTemplate(templateId); 066 } 067 068 /** 069 * Deletes the d d m template with the primary key from the database. Also notifies the appropriate model listeners. 070 * 071 * @param templateId the primary key of the d d m template 072 * @return the d d m template that was removed 073 * @throws PortalException if a d d m template with the primary key could not be found 074 * @throws SystemException if a system exception occurred 075 */ 076 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate deleteDDMTemplate( 077 long templateId) 078 throws com.liferay.portal.kernel.exception.PortalException, 079 com.liferay.portal.kernel.exception.SystemException { 080 return getService().deleteDDMTemplate(templateId); 081 } 082 083 /** 084 * Deletes the d d m template from the database. Also notifies the appropriate model listeners. 085 * 086 * @param ddmTemplate the d d m template 087 * @return the d d m template that was removed 088 * @throws SystemException if a system exception occurred 089 */ 090 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate deleteDDMTemplate( 091 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) 092 throws com.liferay.portal.kernel.exception.SystemException { 093 return getService().deleteDDMTemplate(ddmTemplate); 094 } 095 096 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 097 return getService().dynamicQuery(); 098 } 099 100 /** 101 * Performs a dynamic query on the database and returns the matching rows. 102 * 103 * @param dynamicQuery the dynamic query 104 * @return the matching rows 105 * @throws SystemException if a system exception occurred 106 */ 107 @SuppressWarnings("rawtypes") 108 public static java.util.List dynamicQuery( 109 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 110 throws com.liferay.portal.kernel.exception.SystemException { 111 return getService().dynamicQuery(dynamicQuery); 112 } 113 114 /** 115 * Performs a dynamic query on the database and returns a range of the matching rows. 116 * 117 * <p> 118 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 119 * </p> 120 * 121 * @param dynamicQuery the dynamic query 122 * @param start the lower bound of the range of model instances 123 * @param end the upper bound of the range of model instances (not inclusive) 124 * @return the range of matching rows 125 * @throws SystemException if a system exception occurred 126 */ 127 @SuppressWarnings("rawtypes") 128 public static java.util.List dynamicQuery( 129 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 130 int end) throws com.liferay.portal.kernel.exception.SystemException { 131 return getService().dynamicQuery(dynamicQuery, start, end); 132 } 133 134 /** 135 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 136 * 137 * <p> 138 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 139 * </p> 140 * 141 * @param dynamicQuery the dynamic query 142 * @param start the lower bound of the range of model instances 143 * @param end the upper bound of the range of model instances (not inclusive) 144 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 145 * @return the ordered range of matching rows 146 * @throws SystemException if a system exception occurred 147 */ 148 @SuppressWarnings("rawtypes") 149 public static java.util.List dynamicQuery( 150 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 151 int end, 152 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 153 throws com.liferay.portal.kernel.exception.SystemException { 154 return getService() 155 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 156 } 157 158 /** 159 * Returns the number of rows that match the dynamic query. 160 * 161 * @param dynamicQuery the dynamic query 162 * @return the number of rows that match the dynamic query 163 * @throws SystemException if a system exception occurred 164 */ 165 public static long dynamicQueryCount( 166 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 167 throws com.liferay.portal.kernel.exception.SystemException { 168 return getService().dynamicQueryCount(dynamicQuery); 169 } 170 171 /** 172 * Returns the number of rows that match the dynamic query. 173 * 174 * @param dynamicQuery the dynamic query 175 * @param projection the projection to apply to the query 176 * @return the number of rows that match the dynamic query 177 * @throws SystemException if a system exception occurred 178 */ 179 public static long dynamicQueryCount( 180 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 181 com.liferay.portal.kernel.dao.orm.Projection projection) 182 throws com.liferay.portal.kernel.exception.SystemException { 183 return getService().dynamicQueryCount(dynamicQuery, projection); 184 } 185 186 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchDDMTemplate( 187 long templateId) 188 throws com.liferay.portal.kernel.exception.SystemException { 189 return getService().fetchDDMTemplate(templateId); 190 } 191 192 /** 193 * Returns the d d m template with the matching UUID and company. 194 * 195 * @param uuid the d d m template's UUID 196 * @param companyId the primary key of the company 197 * @return the matching d d m template, or <code>null</code> if a matching d d m template could not be found 198 * @throws SystemException if a system exception occurred 199 */ 200 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchDDMTemplateByUuidAndCompanyId( 201 java.lang.String uuid, long companyId) 202 throws com.liferay.portal.kernel.exception.SystemException { 203 return getService().fetchDDMTemplateByUuidAndCompanyId(uuid, companyId); 204 } 205 206 /** 207 * Returns the d d m template matching the UUID and group. 208 * 209 * @param uuid the d d m template's UUID 210 * @param groupId the primary key of the group 211 * @return the matching d d m template, or <code>null</code> if a matching d d m template could not be found 212 * @throws SystemException if a system exception occurred 213 */ 214 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchDDMTemplateByUuidAndGroupId( 215 java.lang.String uuid, long groupId) 216 throws com.liferay.portal.kernel.exception.SystemException { 217 return getService().fetchDDMTemplateByUuidAndGroupId(uuid, groupId); 218 } 219 220 /** 221 * Returns the d d m template with the primary key. 222 * 223 * @param templateId the primary key of the d d m template 224 * @return the d d m template 225 * @throws PortalException if a d d m template with the primary key could not be found 226 * @throws SystemException if a system exception occurred 227 */ 228 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getDDMTemplate( 229 long templateId) 230 throws com.liferay.portal.kernel.exception.PortalException, 231 com.liferay.portal.kernel.exception.SystemException { 232 return getService().getDDMTemplate(templateId); 233 } 234 235 public static com.liferay.portal.model.PersistedModel getPersistedModel( 236 java.io.Serializable primaryKeyObj) 237 throws com.liferay.portal.kernel.exception.PortalException, 238 com.liferay.portal.kernel.exception.SystemException { 239 return getService().getPersistedModel(primaryKeyObj); 240 } 241 242 /** 243 * Returns the d d m template with the matching UUID and company. 244 * 245 * @param uuid the d d m template's UUID 246 * @param companyId the primary key of the company 247 * @return the matching d d m template 248 * @throws PortalException if a matching d d m template could not be found 249 * @throws SystemException if a system exception occurred 250 */ 251 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getDDMTemplateByUuidAndCompanyId( 252 java.lang.String uuid, long companyId) 253 throws com.liferay.portal.kernel.exception.PortalException, 254 com.liferay.portal.kernel.exception.SystemException { 255 return getService().getDDMTemplateByUuidAndCompanyId(uuid, companyId); 256 } 257 258 /** 259 * Returns the d d m template matching the UUID and group. 260 * 261 * @param uuid the d d m template's UUID 262 * @param groupId the primary key of the group 263 * @return the matching d d m template 264 * @throws PortalException if a matching d d m template could not be found 265 * @throws SystemException if a system exception occurred 266 */ 267 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getDDMTemplateByUuidAndGroupId( 268 java.lang.String uuid, long groupId) 269 throws com.liferay.portal.kernel.exception.PortalException, 270 com.liferay.portal.kernel.exception.SystemException { 271 return getService().getDDMTemplateByUuidAndGroupId(uuid, groupId); 272 } 273 274 /** 275 * Returns a range of all the d d m templates. 276 * 277 * <p> 278 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 279 * </p> 280 * 281 * @param start the lower bound of the range of d d m templates 282 * @param end the upper bound of the range of d d m templates (not inclusive) 283 * @return the range of d d m templates 284 * @throws SystemException if a system exception occurred 285 */ 286 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getDDMTemplates( 287 int start, int end) 288 throws com.liferay.portal.kernel.exception.SystemException { 289 return getService().getDDMTemplates(start, end); 290 } 291 292 /** 293 * Returns the number of d d m templates. 294 * 295 * @return the number of d d m templates 296 * @throws SystemException if a system exception occurred 297 */ 298 public static int getDDMTemplatesCount() 299 throws com.liferay.portal.kernel.exception.SystemException { 300 return getService().getDDMTemplatesCount(); 301 } 302 303 /** 304 * Updates the d d m template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 305 * 306 * @param ddmTemplate the d d m template 307 * @return the d d m template that was updated 308 * @throws SystemException if a system exception occurred 309 */ 310 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateDDMTemplate( 311 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) 312 throws com.liferay.portal.kernel.exception.SystemException { 313 return getService().updateDDMTemplate(ddmTemplate); 314 } 315 316 /** 317 * Returns the Spring bean ID for this bean. 318 * 319 * @return the Spring bean ID for this bean 320 */ 321 public static java.lang.String getBeanIdentifier() { 322 return getService().getBeanIdentifier(); 323 } 324 325 /** 326 * Sets the Spring bean ID for this bean. 327 * 328 * @param beanIdentifier the Spring bean ID for this bean 329 */ 330 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 331 getService().setBeanIdentifier(beanIdentifier); 332 } 333 334 /** 335 * Adds a template. 336 * 337 * @param userId the primary key of the template's creator/owner 338 * @param groupId the primary key of the group 339 * @param classNameId the primary key of the class name for the template's 340 related model 341 * @param classPK the primary key of the template's related entity 342 * @param nameMap the template's locales and localized names 343 * @param descriptionMap the template's locales and localized descriptions 344 * @param type the template's type. For more information, see {@link 345 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 346 * @param mode the template's mode. For more information, see {@link 347 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 348 * @param language the template's script language. For more information, 349 see {@link 350 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 351 * @param script the template's script 352 * @param serviceContext the service context to be applied. Can set the 353 UUID, creation date, modification date, guest permissions, and 354 group permissions for the template. 355 * @return the template 356 * @throws PortalException if a portal exception occurred 357 * @throws SystemException if a system exception occurred 358 */ 359 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate( 360 long userId, long groupId, long classNameId, long classPK, 361 java.util.Map<java.util.Locale, java.lang.String> nameMap, 362 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 363 java.lang.String type, java.lang.String mode, 364 java.lang.String language, java.lang.String script, 365 com.liferay.portal.service.ServiceContext serviceContext) 366 throws com.liferay.portal.kernel.exception.PortalException, 367 com.liferay.portal.kernel.exception.SystemException { 368 return getService() 369 .addTemplate(userId, groupId, classNameId, classPK, nameMap, 370 descriptionMap, type, mode, language, script, serviceContext); 371 } 372 373 /** 374 * Adds a template with additional parameters. 375 * 376 * @param userId the primary key of the template's creator/owner 377 * @param groupId the primary key of the group 378 * @param classNameId the primary key of the class name for the template's 379 related model 380 * @param classPK the primary key of the template's related entity 381 * @param templateKey the unique string identifying the template 382 (optionally <code>null</code>) 383 * @param nameMap the template's locales and localized names 384 * @param descriptionMap the template's locales and localized descriptions 385 * @param type the template's type. For more information, see {@link 386 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 387 * @param mode the template's mode. For more information, see {@link 388 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 389 * @param language the template's script language. For more information, 390 see {@link 391 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 392 * @param script the template's script 393 * @param cacheable whether the template is cacheable 394 * @param smallImage whether the template has a small image 395 * @param smallImageURL the template's small image URL (optionally 396 <code>null</code>) 397 * @param smallImageFile the template's small image file (optionally 398 <code>null</code>) 399 * @param serviceContext the service context to be applied. Can set the 400 UUID, creation date, modification date, guest permissions, and 401 group permissions for the template. 402 * @return the template 403 * @throws PortalException if a portal exception occurred 404 * @throws SystemException if a system exception occurred 405 */ 406 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate( 407 long userId, long groupId, long classNameId, long classPK, 408 java.lang.String templateKey, 409 java.util.Map<java.util.Locale, java.lang.String> nameMap, 410 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 411 java.lang.String type, java.lang.String mode, 412 java.lang.String language, java.lang.String script, boolean cacheable, 413 boolean smallImage, java.lang.String smallImageURL, 414 java.io.File smallImageFile, 415 com.liferay.portal.service.ServiceContext serviceContext) 416 throws com.liferay.portal.kernel.exception.PortalException, 417 com.liferay.portal.kernel.exception.SystemException { 418 return getService() 419 .addTemplate(userId, groupId, classNameId, classPK, 420 templateKey, nameMap, descriptionMap, type, mode, language, script, 421 cacheable, smallImage, smallImageURL, smallImageFile, serviceContext); 422 } 423 424 /** 425 * Adds the resources to the template. 426 * 427 * @param template the template to add resources to 428 * @param addGroupPermissions whether to add group permissions 429 * @param addGuestPermissions whether to add guest permissions 430 * @throws PortalException if a portal exception occurred 431 * @throws SystemException if a system exception occurred 432 */ 433 public static void addTemplateResources( 434 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template, 435 boolean addGroupPermissions, boolean addGuestPermissions) 436 throws com.liferay.portal.kernel.exception.PortalException, 437 com.liferay.portal.kernel.exception.SystemException { 438 getService() 439 .addTemplateResources(template, addGroupPermissions, 440 addGuestPermissions); 441 } 442 443 /** 444 * Adds the model resources with the permissions to the template. 445 * 446 * @param template the template to add resources to 447 * @param groupPermissions the group permissions to be added 448 * @param guestPermissions the guest permissions to be added 449 * @throws PortalException if a portal exception occurred 450 * @throws SystemException if a system exception occurred 451 */ 452 public static void addTemplateResources( 453 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template, 454 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 455 throws com.liferay.portal.kernel.exception.PortalException, 456 com.liferay.portal.kernel.exception.SystemException { 457 getService() 458 .addTemplateResources(template, groupPermissions, guestPermissions); 459 } 460 461 /** 462 * Copies the template, creating a new template with all the values 463 * extracted from the original one. This method supports defining a new name 464 * and description. 465 * 466 * @param userId the primary key of the template's creator/owner 467 * @param templateId the primary key of the template to be copied 468 * @param nameMap the new template's locales and localized names 469 * @param descriptionMap the new template's locales and localized 470 descriptions 471 * @param serviceContext the service context to be applied. Can set the 472 UUID, creation date, modification date, guest permissions, and 473 group permissions for the template. 474 * @return the new template 475 * @throws PortalException if a portal exception occurred 476 * @throws SystemException if a system exception occurred 477 */ 478 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate( 479 long userId, long templateId, 480 java.util.Map<java.util.Locale, java.lang.String> nameMap, 481 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 482 com.liferay.portal.service.ServiceContext serviceContext) 483 throws com.liferay.portal.kernel.exception.PortalException, 484 com.liferay.portal.kernel.exception.SystemException { 485 return getService() 486 .copyTemplate(userId, templateId, nameMap, descriptionMap, 487 serviceContext); 488 } 489 490 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate( 491 long userId, long templateId, 492 com.liferay.portal.service.ServiceContext serviceContext) 493 throws com.liferay.portal.kernel.exception.PortalException, 494 com.liferay.portal.kernel.exception.SystemException { 495 return getService().copyTemplate(userId, templateId, serviceContext); 496 } 497 498 /** 499 * Copies all the templates matching the class name ID, class PK, and type. 500 * This method creates new templates, extracting all the values from the old 501 * ones and updating their class PKs. 502 * 503 * @param userId the primary key of the template's creator/owner 504 * @param classNameId the primary key of the class name for the template's 505 related model 506 * @param oldClassPK the primary key of the old template's related entity 507 * @param newClassPK the primary key of the new template's related entity 508 * @param type the template's type. For more information, see {@link 509 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 510 * @param serviceContext the service context to be applied. Can set the 511 creation date, modification date, guest permissions, and group 512 permissions for the new templates. 513 * @return the new templates 514 * @throws PortalException if a portal exception occurred 515 * @throws SystemException if a system exception occurred 516 */ 517 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> copyTemplates( 518 long userId, long classNameId, long oldClassPK, long newClassPK, 519 java.lang.String type, 520 com.liferay.portal.service.ServiceContext serviceContext) 521 throws com.liferay.portal.kernel.exception.PortalException, 522 com.liferay.portal.kernel.exception.SystemException { 523 return getService() 524 .copyTemplates(userId, classNameId, oldClassPK, newClassPK, 525 type, serviceContext); 526 } 527 528 /** 529 * Deletes the template and its resources. 530 * 531 * @param template the template to be deleted 532 * @throws PortalException if a portal exception occurred 533 * @throws SystemException if a system exception occurred 534 */ 535 public static void deleteTemplate( 536 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template) 537 throws com.liferay.portal.kernel.exception.PortalException, 538 com.liferay.portal.kernel.exception.SystemException { 539 getService().deleteTemplate(template); 540 } 541 542 /** 543 * Deletes the template and its resources. 544 * 545 * @param templateId the primary key of the template to be deleted 546 * @throws PortalException if a portal exception occurred 547 * @throws SystemException if a system exception occurred 548 */ 549 public static void deleteTemplate(long templateId) 550 throws com.liferay.portal.kernel.exception.PortalException, 551 com.liferay.portal.kernel.exception.SystemException { 552 getService().deleteTemplate(templateId); 553 } 554 555 /** 556 * Deletes all the templates of the group. 557 * 558 * @param groupId the primary key of the group 559 * @throws PortalException if a portal exception occurred 560 * @throws SystemException if a system exception occurred 561 */ 562 public static void deleteTemplates(long groupId) 563 throws com.liferay.portal.kernel.exception.PortalException, 564 com.liferay.portal.kernel.exception.SystemException { 565 getService().deleteTemplates(groupId); 566 } 567 568 /** 569 * Returns the template matching the group and template key. 570 * 571 * @param groupId the primary key of the group 572 * @param classNameId the primary key of the class name for the template's 573 related model 574 * @param templateKey the unique string identifying the template 575 * @return the matching template, or <code>null</code> if a matching 576 template could not be found 577 * @throws SystemException if a system exception occurred 578 */ 579 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 580 long groupId, long classNameId, java.lang.String templateKey) 581 throws com.liferay.portal.kernel.exception.SystemException { 582 return getService().fetchTemplate(groupId, classNameId, templateKey); 583 } 584 585 /** 586 * Returns the template matching the group and template key, optionally in 587 * the global scope. 588 * 589 * <p> 590 * This method first searches in the given group. If the template is still 591 * not found and <code>includeGlobalTemplates</code> is set to 592 * <code>true</code>, this method searches the global group. 593 * </p> 594 * 595 * @param groupId the primary key of the group 596 * @param classNameId the primary key of the class name for the template's 597 related model 598 * @param templateKey the unique string identifying the template 599 * @param includeGlobalTemplates whether to include the global scope in the 600 search 601 * @return the matching template, or <code>null</code> if a matching 602 template could not be found 603 * @throws PortalException if a portal exception occurred 604 * @throws SystemException if a system exception occurred 605 */ 606 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 607 long groupId, long classNameId, java.lang.String templateKey, 608 boolean includeGlobalTemplates) 609 throws com.liferay.portal.kernel.exception.PortalException, 610 com.liferay.portal.kernel.exception.SystemException { 611 return getService() 612 .fetchTemplate(groupId, classNameId, templateKey, 613 includeGlobalTemplates); 614 } 615 616 /** 617 * Returns the template with the ID. 618 * 619 * @param templateId the primary key of the template 620 * @return the template with the ID 621 * @throws PortalException if a matching template could not be found 622 * @throws SystemException if a system exception occurred 623 */ 624 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 625 long templateId) 626 throws com.liferay.portal.kernel.exception.PortalException, 627 com.liferay.portal.kernel.exception.SystemException { 628 return getService().getTemplate(templateId); 629 } 630 631 /** 632 * Returns the template matching the group and template key. 633 * 634 * @param groupId the primary key of the group 635 * @param classNameId the primary key of the class name for the template's 636 related model 637 * @param templateKey the unique string identifying the template 638 * @return the matching template 639 * @throws PortalException if a matching template could not be found 640 * @throws SystemException if a system exception occurred 641 */ 642 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 643 long groupId, long classNameId, java.lang.String templateKey) 644 throws com.liferay.portal.kernel.exception.PortalException, 645 com.liferay.portal.kernel.exception.SystemException { 646 return getService().getTemplate(groupId, classNameId, templateKey); 647 } 648 649 /** 650 * Returns the template matching the group and template key, optionally in 651 * the global scope. 652 * 653 * <p> 654 * This method first searches in the group. If the template is still not 655 * found and <code>includeGlobalTemplates</code> is set to 656 * <code>true</code>, this method searches the global group. 657 * </p> 658 * 659 * @param groupId the primary key of the group 660 * @param classNameId the primary key of the class name for the template's 661 related model 662 * @param templateKey the unique string identifying the template 663 * @param includeGlobalTemplates whether to include the global scope in the 664 search 665 * @return the matching template 666 * @throws PortalException if a matching template could not be found 667 * @throws SystemException if a system exception occurred 668 */ 669 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 670 long groupId, long classNameId, java.lang.String templateKey, 671 boolean includeGlobalTemplates) 672 throws com.liferay.portal.kernel.exception.PortalException, 673 com.liferay.portal.kernel.exception.SystemException { 674 return getService() 675 .getTemplate(groupId, classNameId, templateKey, 676 includeGlobalTemplates); 677 } 678 679 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplateBySmallImageId( 680 long smallImageId) 681 throws com.liferay.portal.kernel.exception.PortalException, 682 com.liferay.portal.kernel.exception.SystemException { 683 return getService().getTemplateBySmallImageId(smallImageId); 684 } 685 686 /** 687 * Returns all the templates with the class PK. 688 * 689 * @param classPK the primary key of the template's related entity 690 * @return the templates with the class PK 691 * @throws SystemException if a system exception occurred 692 */ 693 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 694 long classPK) 695 throws com.liferay.portal.kernel.exception.SystemException { 696 return getService().getTemplates(classPK); 697 } 698 699 /** 700 * Returns all the templates matching the group and class name ID. 701 * 702 * @param groupId the primary key of the group 703 * @param classNameId the primary key of the class name for the template's 704 related model 705 * @return the matching templates 706 * @throws SystemException if a system exception occurred 707 */ 708 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 709 long groupId, long classNameId) 710 throws com.liferay.portal.kernel.exception.SystemException { 711 return getService().getTemplates(groupId, classNameId); 712 } 713 714 /** 715 * Returns all the templates matching the group, class name ID, and class 716 * PK. 717 * 718 * @param groupId the primary key of the group 719 * @param classNameId the primary key of the class name for the template's 720 related model 721 * @param classPK the primary key of the template's related entity 722 * @return the matching templates 723 * @throws SystemException if a system exception occurred 724 */ 725 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 726 long groupId, long classNameId, long classPK) 727 throws com.liferay.portal.kernel.exception.SystemException { 728 return getService().getTemplates(groupId, classNameId, classPK); 729 } 730 731 /** 732 * Returns all the templates matching the group, class name ID, class PK, 733 * and type. 734 * 735 * @param groupId the primary key of the group 736 * @param classNameId the primary key of the class name for the template's 737 related model 738 * @param classPK the primary key of the template's related entity 739 * @param type the template's type. For more information, see {@link 740 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 741 * @return the matching templates 742 * @throws SystemException if a system exception occurred 743 */ 744 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 745 long groupId, long classNameId, long classPK, java.lang.String type) 746 throws com.liferay.portal.kernel.exception.SystemException { 747 return getService().getTemplates(groupId, classNameId, classPK, type); 748 } 749 750 /** 751 * Returns all the templates matching the group, class name ID, class PK, 752 * type, and mode. 753 * 754 * @param groupId the primary key of the group 755 * @param classNameId the primary key of the class name for the template's 756 related model 757 * @param classPK the primary key of the template's related entity 758 * @param type the template's type. For more information, see {@link 759 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 760 * @param mode the template's mode. For more information, see {@link 761 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 762 * @return the matching templates 763 * @throws SystemException if a system exception occurred 764 */ 765 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 766 long groupId, long classNameId, long classPK, java.lang.String type, 767 java.lang.String mode) 768 throws com.liferay.portal.kernel.exception.SystemException { 769 return getService() 770 .getTemplates(groupId, classNameId, classPK, type, mode); 771 } 772 773 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 774 long groupId, long classPK) 775 throws com.liferay.portal.kernel.exception.SystemException { 776 return getService().getTemplatesByClassPK(groupId, classPK); 777 } 778 779 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 780 long groupId, long classPK, int start, int end) 781 throws com.liferay.portal.kernel.exception.SystemException { 782 return getService().getTemplatesByClassPK(groupId, classPK, start, end); 783 } 784 785 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 786 long[] groupIds, long classPK) 787 throws com.liferay.portal.kernel.exception.SystemException { 788 return getService().getTemplatesByClassPK(groupIds, classPK); 789 } 790 791 /** 792 * Returns the number of templates matching the group and class PK. 793 * 794 * @param groupId the primary key of the group 795 * @param classPK the primary key of the template's related entity 796 * @return the number of templates belonging to the group and class PK 797 * @throws SystemException if a system exception occurred 798 */ 799 public static int getTemplatesByClassPKCount(long groupId, long classPK) 800 throws com.liferay.portal.kernel.exception.SystemException { 801 return getService().getTemplatesByClassPKCount(groupId, classPK); 802 } 803 804 /** 805 * Returns an ordered range of all the templates matching the group and 806 * structure class name ID. 807 * 808 * <p> 809 * Useful when paginating results. Returns a maximum of <code>end - 810 * start</code> instances. <code>start</code> and <code>end</code> are not 811 * primary keys, they are indexes in the result set. Thus, <code>0</code> 812 * refers to the first result in the set. Setting both <code>start</code> 813 * and <code>end</code> to {@link 814 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 815 * result set. 816 * </p> 817 * 818 * @param groupId the primary key of the group 819 * @param structureClassNameId the primary key of the class name for the 820 template's related structure 821 * @param start the lower bound of the range of templates to return 822 * @param end the upper bound of the range of templates to return (not 823 inclusive) 824 * @param orderByComparator the comparator to order the templates 825 (optionally <code>null</code>) 826 * @return the range of matching templates ordered by the comparator 827 * @throws SystemException if a system exception occurred 828 */ 829 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByStructureClassNameId( 830 long groupId, long structureClassNameId, int start, int end, 831 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 832 throws com.liferay.portal.kernel.exception.SystemException { 833 return getService() 834 .getTemplatesByStructureClassNameId(groupId, 835 structureClassNameId, start, end, orderByComparator); 836 } 837 838 /** 839 * Returns the number of templates matching the group and structure class 840 * name ID, including Generic Templates. 841 * 842 * @param groupId the primary key of the group 843 * @param structureClassNameId the primary key of the class name for the 844 template's related structure 845 * @return the number of matching templates 846 * @throws SystemException if a system exception occurred 847 */ 848 public static int getTemplatesByStructureClassNameIdCount(long groupId, 849 long structureClassNameId) 850 throws com.liferay.portal.kernel.exception.SystemException { 851 return getService() 852 .getTemplatesByStructureClassNameIdCount(groupId, 853 structureClassNameId); 854 } 855 856 /** 857 * Returns the number of templates belonging to the group. 858 * 859 * @param groupId the primary key of the group 860 * @return the number of templates belonging to the group 861 * @throws SystemException if a system exception occurred 862 */ 863 public static int getTemplatesCount(long groupId) 864 throws com.liferay.portal.kernel.exception.SystemException { 865 return getService().getTemplatesCount(groupId); 866 } 867 868 /** 869 * Returns the number of templates matching the group and class name ID. 870 * 871 * @param groupId the primary key of the group 872 * @param classNameId the primary key of the class name for the template's 873 related model 874 * @return the number of matching templates 875 * @throws SystemException if a system exception occurred 876 */ 877 public static int getTemplatesCount(long groupId, long classNameId) 878 throws com.liferay.portal.kernel.exception.SystemException { 879 return getService().getTemplatesCount(groupId, classNameId); 880 } 881 882 /** 883 * Returns the number of templates matching the group, class name ID, and 884 * class PK. 885 * 886 * @param groupId the primary key of the group 887 * @param classNameId the primary key of the class name for the template's 888 related model 889 * @param classPK the primary key of the template's related entity 890 * @return the number of matching templates 891 * @throws SystemException if a system exception occurred 892 */ 893 public static int getTemplatesCount(long groupId, long classNameId, 894 long classPK) 895 throws com.liferay.portal.kernel.exception.SystemException { 896 return getService().getTemplatesCount(groupId, classNameId, classPK); 897 } 898 899 /** 900 * Returns an ordered range of all the templates matching the group, class 901 * name ID, class PK, type, and mode, and matching the keywords in the 902 * template names and descriptions. 903 * 904 * <p> 905 * Useful when paginating results. Returns a maximum of <code>end - 906 * start</code> instances. <code>start</code> and <code>end</code> are not 907 * primary keys, they are indexes in the result set. Thus, <code>0</code> 908 * refers to the first result in the set. Setting both <code>start</code> 909 * and <code>end</code> to {@link 910 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 911 * result set. 912 * </p> 913 * 914 * @param companyId the primary key of the template's company 915 * @param groupId the primary key of the group 916 * @param classNameId the primary key of the class name for the template's 917 related model 918 * @param classPK the primary key of the template's related entity 919 * @param keywords the keywords (space separated), which may occur in the 920 template's name or description (optionally <code>null</code>) 921 * @param type the template's type (optionally <code>null</code>). For more 922 information, see {@link 923 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 924 * @param mode the template's mode (optionally <code>null</code>). For more 925 information, see {@link 926 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 927 * @param start the lower bound of the range of templates to return 928 * @param end the upper bound of the range of templates to return (not 929 inclusive) 930 * @param orderByComparator the comparator to order the templates 931 (optionally <code>null</code>) 932 * @return the range of matching templates ordered by the comparator 933 * @throws SystemException if a system exception occurred 934 */ 935 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 936 long companyId, long groupId, long classNameId, long classPK, 937 java.lang.String keywords, java.lang.String type, 938 java.lang.String mode, int start, int end, 939 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 940 throws com.liferay.portal.kernel.exception.SystemException { 941 return getService() 942 .search(companyId, groupId, classNameId, classPK, keywords, 943 type, mode, start, end, orderByComparator); 944 } 945 946 /** 947 * Returns an ordered range of all the templates matching the group, class 948 * name ID, class PK, name keyword, description keyword, type, mode, and 949 * language. 950 * 951 * <p> 952 * Useful when paginating results. Returns a maximum of <code>end - 953 * start</code> instances. <code>start</code> and <code>end</code> are not 954 * primary keys, they are indexes in the result set. Thus, <code>0</code> 955 * refers to the first result in the set. Setting both <code>start</code> 956 * and <code>end</code> to {@link 957 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 958 * result set. 959 * </p> 960 * 961 * @param companyId the primary key of the template's company 962 * @param groupId the primary key of the group 963 * @param classNameId the primary key of the class name for the template's 964 related model 965 * @param classPK the primary key of the template's related entity 966 * @param name the name keywords (optionally <code>null</code>) 967 * @param description the description keywords (optionally 968 <code>null</code>) 969 * @param type the template's type (optionally <code>null</code>). For more 970 information, see {@link 971 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 972 * @param mode the template's mode (optionally <code>null</code>). For more 973 information, see {@link 974 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 975 * @param language the template's script language (optionally 976 <code>null</code>). For more information, see {@link 977 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 978 * @param andOperator whether every field must match its keywords, or just 979 one field 980 * @param start the lower bound of the range of templates to return 981 * @param end the upper bound of the range of templates to return (not 982 inclusive) 983 * @param orderByComparator the comparator to order the templates 984 (optionally <code>null</code>) 985 * @return the range of matching templates ordered by the comparator 986 * @throws SystemException if a system exception occurred 987 */ 988 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 989 long companyId, long groupId, long classNameId, long classPK, 990 java.lang.String name, java.lang.String description, 991 java.lang.String type, java.lang.String mode, 992 java.lang.String language, boolean andOperator, int start, int end, 993 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 994 throws com.liferay.portal.kernel.exception.SystemException { 995 return getService() 996 .search(companyId, groupId, classNameId, classPK, name, 997 description, type, mode, language, andOperator, start, end, 998 orderByComparator); 999 } 1000 1001 /** 1002 * Returns an ordered range of all the templates matching the group IDs, 1003 * class Name IDs, class PK, type, and mode, and include the keywords on its 1004 * names and descriptions. 1005 * 1006 * <p> 1007 * Useful when paginating results. Returns a maximum of <code>end - 1008 * start</code> instances. <code>start</code> and <code>end</code> are not 1009 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1010 * refers to the first result in the set. Setting both <code>start</code> 1011 * and <code>end</code> to {@link 1012 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1013 * result set. 1014 * </p> 1015 * 1016 * @param companyId the primary key of the template's company 1017 * @param groupIds the primary keys of the groups 1018 * @param classNameIds the primary keys of the entity's instances the 1019 templates are related to 1020 * @param classPKs the primary keys of the template's related entities 1021 * @param keywords the keywords (space separated), which may occur in the 1022 template's name or description (optionally <code>null</code>) 1023 * @param type the template's type (optionally <code>null</code>). For more 1024 information, see {@link 1025 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1026 * @param mode the template's mode (optionally <code>null</code>). For more 1027 information, see {@link 1028 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1029 * @param start the lower bound of the range of templates to return 1030 * @param end the upper bound of the range of templates to return (not 1031 inclusive) 1032 * @param orderByComparator the comparator to order the templates 1033 (optionally <code>null</code>) 1034 * @return the range of matching templates ordered by the comparator 1035 * @throws SystemException if a system exception occurred 1036 */ 1037 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 1038 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 1039 java.lang.String keywords, java.lang.String type, 1040 java.lang.String mode, int start, int end, 1041 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 1042 throws com.liferay.portal.kernel.exception.SystemException { 1043 return getService() 1044 .search(companyId, groupIds, classNameIds, classPKs, 1045 keywords, type, mode, start, end, orderByComparator); 1046 } 1047 1048 /** 1049 * Returns an ordered range of all the templates matching the group IDs, 1050 * class name IDs, class PK, name keyword, description keyword, type, mode, 1051 * and language. 1052 * 1053 * <p> 1054 * Useful when paginating results. Returns a maximum of <code>end - 1055 * start</code> instances. <code>start</code> and <code>end</code> are not 1056 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1057 * refers to the first result in the set. Setting both <code>start</code> 1058 * and <code>end</code> to {@link 1059 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1060 * result set. 1061 * </p> 1062 * 1063 * @param companyId the primary key of the template's company 1064 * @param groupIds the primary keys of the groups 1065 * @param classNameIds the primary keys of the entity's instances the 1066 templates are related to 1067 * @param classPKs the primary keys of the template's related entities 1068 * @param name the name keywords (optionally <code>null</code>) 1069 * @param description the description keywords (optionally 1070 <code>null</code>) 1071 * @param type the template's type (optionally <code>null</code>). For more 1072 information, see {@link 1073 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1074 * @param mode the template's mode (optionally <code>null</code>). For more 1075 information, see {@link 1076 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1077 * @param language the template's script language (optionally 1078 <code>null</code>). For more information, see {@link 1079 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1080 * @param andOperator whether every field must match its keywords, or just 1081 one field. 1082 * @param start the lower bound of the range of templates to return 1083 * @param end the upper bound of the range of templates to return (not 1084 inclusive) 1085 * @param orderByComparator the comparator to order the templates 1086 (optionally <code>null</code>) 1087 * @return the range of matching templates ordered by the comparator 1088 * @throws SystemException if a system exception occurred 1089 */ 1090 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 1091 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 1092 java.lang.String name, java.lang.String description, 1093 java.lang.String type, java.lang.String mode, 1094 java.lang.String language, boolean andOperator, int start, int end, 1095 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 1096 throws com.liferay.portal.kernel.exception.SystemException { 1097 return getService() 1098 .search(companyId, groupIds, classNameIds, classPKs, name, 1099 description, type, mode, language, andOperator, start, end, 1100 orderByComparator); 1101 } 1102 1103 /** 1104 * Returns the number of templates matching the group, class name ID, class 1105 * PK, type, and matching the keywords in the template names and 1106 * descriptions. 1107 * 1108 * @param companyId the primary key of the template's company 1109 * @param groupId the primary key of the group 1110 * @param classNameId the primary key of the class name for the template's 1111 related model 1112 * @param classPK the primary key of the template's related entity 1113 * @param keywords the keywords (space separated), which may occur in the 1114 template's name or description (optionally <code>null</code>) 1115 * @param type the template's type (optionally <code>null</code>). For more 1116 information, see {@link 1117 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1118 * @param mode the template's mode (optionally <code>null</code>). For more 1119 information, see {@link 1120 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1121 * @return the number of matching templates 1122 * @throws SystemException if a system exception occurred 1123 */ 1124 public static int searchCount(long companyId, long groupId, 1125 long classNameId, long classPK, java.lang.String keywords, 1126 java.lang.String type, java.lang.String mode) 1127 throws com.liferay.portal.kernel.exception.SystemException { 1128 return getService() 1129 .searchCount(companyId, groupId, classNameId, classPK, 1130 keywords, type, mode); 1131 } 1132 1133 /** 1134 * Returns the number of templates matching the group, class name ID, class 1135 * PK, name keyword, description keyword, type, mode, and language. 1136 * 1137 * @param companyId the primary key of the template's company 1138 * @param groupId the primary key of the group 1139 * @param classNameId the primary key of the class name for the template's 1140 related model 1141 * @param classPK the primary key of the template's related entity 1142 * @param name the name keywords (optionally <code>null</code>) 1143 * @param description the description keywords (optionally 1144 <code>null</code>) 1145 * @param type the template's type (optionally <code>null</code>). For more 1146 information, see {@link 1147 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1148 * @param mode the template's mode (optionally <code>null</code>). For more 1149 information, see {@link 1150 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1151 * @param language the template's script language (optionally 1152 <code>null</code>). For more information, see {@link 1153 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1154 * @param andOperator whether every field must match its keywords, or just 1155 one field. 1156 * @return the number of matching templates 1157 * @throws SystemException if a system exception occurred 1158 */ 1159 public static int searchCount(long companyId, long groupId, 1160 long classNameId, long classPK, java.lang.String name, 1161 java.lang.String description, java.lang.String type, 1162 java.lang.String mode, java.lang.String language, boolean andOperator) 1163 throws com.liferay.portal.kernel.exception.SystemException { 1164 return getService() 1165 .searchCount(companyId, groupId, classNameId, classPK, name, 1166 description, type, mode, language, andOperator); 1167 } 1168 1169 /** 1170 * Returns the number of templates matching the group IDs, class name IDs, 1171 * class PK, type, and mode, and matching the keywords in the template names 1172 * and descriptions. 1173 * 1174 * @param companyId the primary key of the template's company 1175 * @param groupIds the primary keys of the groups 1176 * @param classNameIds the primary keys of the entity's instance the 1177 templates are related to 1178 * @param classPKs the primary keys of the template's related entities 1179 * @param keywords the keywords (space separated), which may occur in the 1180 template's name or description (optionally <code>null</code>) 1181 * @param type the template's type (optionally <code>null</code>). For more 1182 information, see {@link 1183 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1184 * @param mode the template's mode (optionally <code>null</code>). For more 1185 information, see {@link 1186 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1187 * @return the number of matching templates 1188 * @throws SystemException if a system exception occurred 1189 */ 1190 public static int searchCount(long companyId, long[] groupIds, 1191 long[] classNameIds, long[] classPKs, java.lang.String keywords, 1192 java.lang.String type, java.lang.String mode) 1193 throws com.liferay.portal.kernel.exception.SystemException { 1194 return getService() 1195 .searchCount(companyId, groupIds, classNameIds, classPKs, 1196 keywords, type, mode); 1197 } 1198 1199 /** 1200 * Returns the number of templates matching the group IDs, class name IDs, 1201 * class PKs, name keyword, description keyword, type, mode, and language. 1202 * 1203 * @param companyId the primary key of the templates company 1204 * @param groupIds the primary keys of the groups 1205 * @param classNameIds the primary keys of the entity's instance the 1206 templates are related to 1207 * @param classPKs the primary keys of the template's related entities 1208 * @param name the name keywords (optionally <code>null</code>) 1209 * @param description the description keywords (optionally 1210 <code>null</code>) 1211 * @param type the template's type (optionally <code>null</code>). For more 1212 information, see {@link 1213 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1214 * @param mode the template's mode (optionally <code>null</code>). For more 1215 information, see {@link 1216 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1217 * @param language the template's script language (optionally 1218 <code>null</code>). For more information, see {@link 1219 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1220 * @param andOperator whether every field must match its keywords, or just 1221 one field. 1222 * @return the number of matching templates 1223 * @throws SystemException if a system exception occurred 1224 */ 1225 public static int searchCount(long companyId, long[] groupIds, 1226 long[] classNameIds, long[] classPKs, java.lang.String name, 1227 java.lang.String description, java.lang.String type, 1228 java.lang.String mode, java.lang.String language, boolean andOperator) 1229 throws com.liferay.portal.kernel.exception.SystemException { 1230 return getService() 1231 .searchCount(companyId, groupIds, classNameIds, classPKs, 1232 name, description, type, mode, language, andOperator); 1233 } 1234 1235 /** 1236 * Updates the template matching the ID. 1237 * 1238 * @param templateId the primary key of the template 1239 * @param classPK the primary key of the template's related entity 1240 * @param nameMap the template's new locales and localized names 1241 * @param descriptionMap the template's new locales and localized 1242 description 1243 * @param type the template's type. For more information, see {@link 1244 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1245 * @param mode the template's mode. For more information, see {@link 1246 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1247 * @param language the template's script language. For more information, 1248 see {@link 1249 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1250 * @param script the template's script 1251 * @param cacheable whether the template is cacheable 1252 * @param smallImage whether the template has a small image 1253 * @param smallImageURL the template's small image URL (optionally 1254 <code>null</code>) 1255 * @param smallImageFile the template's small image file (optionally 1256 <code>null</code>) 1257 * @param serviceContext the service context to be applied. Can set the 1258 modification date. 1259 * @return the updated template 1260 * @throws PortalException if a portal exception occurred 1261 * @throws SystemException if a system exception occurred 1262 */ 1263 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate( 1264 long templateId, long classPK, 1265 java.util.Map<java.util.Locale, java.lang.String> nameMap, 1266 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1267 java.lang.String type, java.lang.String mode, 1268 java.lang.String language, java.lang.String script, boolean cacheable, 1269 boolean smallImage, java.lang.String smallImageURL, 1270 java.io.File smallImageFile, 1271 com.liferay.portal.service.ServiceContext serviceContext) 1272 throws com.liferay.portal.kernel.exception.PortalException, 1273 com.liferay.portal.kernel.exception.SystemException { 1274 return getService() 1275 .updateTemplate(templateId, classPK, nameMap, 1276 descriptionMap, type, mode, language, script, cacheable, 1277 smallImage, smallImageURL, smallImageFile, serviceContext); 1278 } 1279 1280 public static DDMTemplateLocalService getService() { 1281 if (_service == null) { 1282 _service = (DDMTemplateLocalService)PortalBeanLocatorUtil.locate(DDMTemplateLocalService.class.getName()); 1283 1284 ReferenceRegistry.registerReference(DDMTemplateLocalServiceUtil.class, 1285 "_service"); 1286 } 1287 1288 return _service; 1289 } 1290 1291 /** 1292 * @deprecated As of 6.2.0 1293 */ 1294 public void setService(DDMTemplateLocalService service) { 1295 } 1296 1297 private static DDMTemplateLocalService _service; 1298 }