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 public static void deleteTemplates(long groupId, long classNameId) 569 throws com.liferay.portal.kernel.exception.PortalException, 570 com.liferay.portal.kernel.exception.SystemException { 571 getService().deleteTemplates(groupId, classNameId); 572 } 573 574 /** 575 * Returns the template matching the group and template key. 576 * 577 * @param groupId the primary key of the group 578 * @param classNameId the primary key of the class name for the template's 579 related model 580 * @param templateKey the unique string identifying the template 581 * @return the matching template, or <code>null</code> if a matching 582 template could not be found 583 * @throws SystemException if a system exception occurred 584 */ 585 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 586 long groupId, long classNameId, java.lang.String templateKey) 587 throws com.liferay.portal.kernel.exception.SystemException { 588 return getService().fetchTemplate(groupId, classNameId, templateKey); 589 } 590 591 /** 592 * Returns the template matching the group and template key, optionally in 593 * the global scope. 594 * 595 * <p> 596 * This method first searches in the given group. If the template is still 597 * not found and <code>includeGlobalTemplates</code> is set to 598 * <code>true</code>, this method searches the global group. 599 * </p> 600 * 601 * @param groupId the primary key of the group 602 * @param classNameId the primary key of the class name for the template's 603 related model 604 * @param templateKey the unique string identifying the template 605 * @param includeGlobalTemplates whether to include the global scope in the 606 search 607 * @return the matching template, or <code>null</code> if a matching 608 template could not be found 609 * @throws PortalException if a portal exception occurred 610 * @throws SystemException if a system exception occurred 611 */ 612 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate( 613 long groupId, long classNameId, java.lang.String templateKey, 614 boolean includeGlobalTemplates) 615 throws com.liferay.portal.kernel.exception.PortalException, 616 com.liferay.portal.kernel.exception.SystemException { 617 return getService() 618 .fetchTemplate(groupId, classNameId, templateKey, 619 includeGlobalTemplates); 620 } 621 622 /** 623 * Returns the template with the ID. 624 * 625 * @param templateId the primary key of the template 626 * @return the template with the ID 627 * @throws PortalException if a matching template could not be found 628 * @throws SystemException if a system exception occurred 629 */ 630 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 631 long templateId) 632 throws com.liferay.portal.kernel.exception.PortalException, 633 com.liferay.portal.kernel.exception.SystemException { 634 return getService().getTemplate(templateId); 635 } 636 637 /** 638 * Returns the template matching the group and template key. 639 * 640 * @param groupId the primary key of the group 641 * @param classNameId the primary key of the class name for the template's 642 related model 643 * @param templateKey the unique string identifying the template 644 * @return the matching template 645 * @throws PortalException if a matching template could not be found 646 * @throws SystemException if a system exception occurred 647 */ 648 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 649 long groupId, long classNameId, java.lang.String templateKey) 650 throws com.liferay.portal.kernel.exception.PortalException, 651 com.liferay.portal.kernel.exception.SystemException { 652 return getService().getTemplate(groupId, classNameId, templateKey); 653 } 654 655 /** 656 * Returns the template matching the group and template key, optionally in 657 * the global scope. 658 * 659 * <p> 660 * This method first searches in the group. If the template is still not 661 * found and <code>includeGlobalTemplates</code> is set to 662 * <code>true</code>, this method searches the global group. 663 * </p> 664 * 665 * @param groupId the primary key of the group 666 * @param classNameId the primary key of the class name for the template's 667 related model 668 * @param templateKey the unique string identifying the template 669 * @param includeGlobalTemplates whether to include the global scope in the 670 search 671 * @return the matching template 672 * @throws PortalException if a matching template could not be found 673 * @throws SystemException if a system exception occurred 674 */ 675 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate( 676 long groupId, long classNameId, java.lang.String templateKey, 677 boolean includeGlobalTemplates) 678 throws com.liferay.portal.kernel.exception.PortalException, 679 com.liferay.portal.kernel.exception.SystemException { 680 return getService() 681 .getTemplate(groupId, classNameId, templateKey, 682 includeGlobalTemplates); 683 } 684 685 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplateBySmallImageId( 686 long smallImageId) 687 throws com.liferay.portal.kernel.exception.PortalException, 688 com.liferay.portal.kernel.exception.SystemException { 689 return getService().getTemplateBySmallImageId(smallImageId); 690 } 691 692 /** 693 * Returns all the templates with the class PK. 694 * 695 * @param classPK the primary key of the template's related entity 696 * @return the templates with the class PK 697 * @throws SystemException if a system exception occurred 698 */ 699 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 700 long classPK) 701 throws com.liferay.portal.kernel.exception.SystemException { 702 return getService().getTemplates(classPK); 703 } 704 705 /** 706 * Returns all the templates matching the group and class name ID. 707 * 708 * @param groupId the primary key of the group 709 * @param classNameId the primary key of the class name for the template's 710 related model 711 * @return the matching templates 712 * @throws SystemException if a system exception occurred 713 */ 714 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 715 long groupId, long classNameId) 716 throws com.liferay.portal.kernel.exception.SystemException { 717 return getService().getTemplates(groupId, classNameId); 718 } 719 720 /** 721 * Returns all the templates matching the group, class name ID, and class 722 * PK. 723 * 724 * @param groupId the primary key of the group 725 * @param classNameId the primary key of the class name for the template's 726 related model 727 * @param classPK the primary key of the template's related entity 728 * @return the matching templates 729 * @throws SystemException if a system exception occurred 730 */ 731 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 732 long groupId, long classNameId, long classPK) 733 throws com.liferay.portal.kernel.exception.SystemException { 734 return getService().getTemplates(groupId, classNameId, classPK); 735 } 736 737 /** 738 * Returns all the templates matching the group, class name ID, class PK, 739 * and type. 740 * 741 * @param groupId the primary key of the group 742 * @param classNameId the primary key of the class name for the template's 743 related model 744 * @param classPK the primary key of the template's related entity 745 * @param type the template's type. For more information, see {@link 746 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 747 * @return the matching templates 748 * @throws SystemException if a system exception occurred 749 */ 750 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 751 long groupId, long classNameId, long classPK, java.lang.String type) 752 throws com.liferay.portal.kernel.exception.SystemException { 753 return getService().getTemplates(groupId, classNameId, classPK, type); 754 } 755 756 /** 757 * Returns all the templates matching the group, class name ID, class PK, 758 * type, and mode. 759 * 760 * @param groupId the primary key of the group 761 * @param classNameId the primary key of the class name for the template's 762 related model 763 * @param classPK the primary key of the template's related entity 764 * @param type the template's type. For more information, see {@link 765 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 766 * @param mode the template's mode. For more information, see {@link 767 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 768 * @return the matching templates 769 * @throws SystemException if a system exception occurred 770 */ 771 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates( 772 long groupId, long classNameId, long classPK, java.lang.String type, 773 java.lang.String mode) 774 throws com.liferay.portal.kernel.exception.SystemException { 775 return getService() 776 .getTemplates(groupId, classNameId, classPK, type, mode); 777 } 778 779 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 780 long groupId, long classPK) 781 throws com.liferay.portal.kernel.exception.SystemException { 782 return getService().getTemplatesByClassPK(groupId, classPK); 783 } 784 785 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 786 long groupId, long classPK, int start, int end) 787 throws com.liferay.portal.kernel.exception.SystemException { 788 return getService().getTemplatesByClassPK(groupId, classPK, start, end); 789 } 790 791 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK( 792 long[] groupIds, long classPK) 793 throws com.liferay.portal.kernel.exception.SystemException { 794 return getService().getTemplatesByClassPK(groupIds, classPK); 795 } 796 797 /** 798 * Returns the number of templates matching the group and class PK. 799 * 800 * @param groupId the primary key of the group 801 * @param classPK the primary key of the template's related entity 802 * @return the number of templates belonging to the group and class PK 803 * @throws SystemException if a system exception occurred 804 */ 805 public static int getTemplatesByClassPKCount(long groupId, long classPK) 806 throws com.liferay.portal.kernel.exception.SystemException { 807 return getService().getTemplatesByClassPKCount(groupId, classPK); 808 } 809 810 /** 811 * Returns an ordered range of all the templates matching the group and 812 * structure class name ID. 813 * 814 * <p> 815 * Useful when paginating results. Returns a maximum of <code>end - 816 * start</code> instances. <code>start</code> and <code>end</code> are not 817 * primary keys, they are indexes in the result set. Thus, <code>0</code> 818 * refers to the first result in the set. Setting both <code>start</code> 819 * and <code>end</code> to {@link 820 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 821 * result set. 822 * </p> 823 * 824 * @param groupId the primary key of the group 825 * @param structureClassNameId the primary key of the class name for the 826 template's related structure 827 * @param start the lower bound of the range of templates to return 828 * @param end the upper bound of the range of templates to return (not 829 inclusive) 830 * @param orderByComparator the comparator to order the templates 831 (optionally <code>null</code>) 832 * @return the range of matching templates ordered by the comparator 833 * @throws SystemException if a system exception occurred 834 */ 835 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByStructureClassNameId( 836 long groupId, long structureClassNameId, int start, int end, 837 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 838 throws com.liferay.portal.kernel.exception.SystemException { 839 return getService() 840 .getTemplatesByStructureClassNameId(groupId, 841 structureClassNameId, start, end, orderByComparator); 842 } 843 844 /** 845 * Returns the number of templates matching the group and structure class 846 * name ID, including Generic Templates. 847 * 848 * @param groupId the primary key of the group 849 * @param structureClassNameId the primary key of the class name for the 850 template's related structure 851 * @return the number of matching templates 852 * @throws SystemException if a system exception occurred 853 */ 854 public static int getTemplatesByStructureClassNameIdCount(long groupId, 855 long structureClassNameId) 856 throws com.liferay.portal.kernel.exception.SystemException { 857 return getService() 858 .getTemplatesByStructureClassNameIdCount(groupId, 859 structureClassNameId); 860 } 861 862 /** 863 * Returns the number of templates belonging to the group. 864 * 865 * @param groupId the primary key of the group 866 * @return the number of templates belonging to the group 867 * @throws SystemException if a system exception occurred 868 */ 869 public static int getTemplatesCount(long groupId) 870 throws com.liferay.portal.kernel.exception.SystemException { 871 return getService().getTemplatesCount(groupId); 872 } 873 874 /** 875 * Returns the number of templates matching the group and class name ID. 876 * 877 * @param groupId the primary key of the group 878 * @param classNameId the primary key of the class name for the template's 879 related model 880 * @return the number of matching templates 881 * @throws SystemException if a system exception occurred 882 */ 883 public static int getTemplatesCount(long groupId, long classNameId) 884 throws com.liferay.portal.kernel.exception.SystemException { 885 return getService().getTemplatesCount(groupId, classNameId); 886 } 887 888 /** 889 * Returns the number of templates matching the group, class name ID, and 890 * class PK. 891 * 892 * @param groupId the primary key of the group 893 * @param classNameId the primary key of the class name for the template's 894 related model 895 * @param classPK the primary key of the template's related entity 896 * @return the number of matching templates 897 * @throws SystemException if a system exception occurred 898 */ 899 public static int getTemplatesCount(long groupId, long classNameId, 900 long classPK) 901 throws com.liferay.portal.kernel.exception.SystemException { 902 return getService().getTemplatesCount(groupId, classNameId, classPK); 903 } 904 905 /** 906 * Returns an ordered range of all the templates matching the group, class 907 * name ID, class PK, type, and mode, and matching the keywords in the 908 * template names and descriptions. 909 * 910 * <p> 911 * Useful when paginating results. Returns a maximum of <code>end - 912 * start</code> instances. <code>start</code> and <code>end</code> are not 913 * primary keys, they are indexes in the result set. Thus, <code>0</code> 914 * refers to the first result in the set. Setting both <code>start</code> 915 * and <code>end</code> to {@link 916 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 917 * result set. 918 * </p> 919 * 920 * @param companyId the primary key of the template's company 921 * @param groupId the primary key of the group 922 * @param classNameId the primary key of the class name for the template's 923 related model 924 * @param classPK the primary key of the template's related entity 925 * @param keywords the keywords (space separated), which may occur in the 926 template's name or description (optionally <code>null</code>) 927 * @param type the template's type (optionally <code>null</code>). For more 928 information, see {@link 929 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 930 * @param mode the template's mode (optionally <code>null</code>). For more 931 information, see {@link 932 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 933 * @param start the lower bound of the range of templates to return 934 * @param end the upper bound of the range of templates to return (not 935 inclusive) 936 * @param orderByComparator the comparator to order the templates 937 (optionally <code>null</code>) 938 * @return the range of matching templates ordered by the comparator 939 * @throws SystemException if a system exception occurred 940 */ 941 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 942 long companyId, long groupId, long classNameId, long classPK, 943 java.lang.String keywords, java.lang.String type, 944 java.lang.String mode, int start, int end, 945 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 946 throws com.liferay.portal.kernel.exception.SystemException { 947 return getService() 948 .search(companyId, groupId, classNameId, classPK, keywords, 949 type, mode, start, end, orderByComparator); 950 } 951 952 /** 953 * Returns an ordered range of all the templates matching the group, class 954 * name ID, class PK, name keyword, description keyword, type, mode, and 955 * language. 956 * 957 * <p> 958 * Useful when paginating results. Returns a maximum of <code>end - 959 * start</code> instances. <code>start</code> and <code>end</code> are not 960 * primary keys, they are indexes in the result set. Thus, <code>0</code> 961 * refers to the first result in the set. Setting both <code>start</code> 962 * and <code>end</code> to {@link 963 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 964 * result set. 965 * </p> 966 * 967 * @param companyId the primary key of the template's company 968 * @param groupId the primary key of the group 969 * @param classNameId the primary key of the class name for the template's 970 related model 971 * @param classPK the primary key of the template's related entity 972 * @param name the name keywords (optionally <code>null</code>) 973 * @param description the description keywords (optionally 974 <code>null</code>) 975 * @param type the template's type (optionally <code>null</code>). For more 976 information, see {@link 977 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 978 * @param mode the template's mode (optionally <code>null</code>). For more 979 information, see {@link 980 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 981 * @param language the template's script language (optionally 982 <code>null</code>). For more information, see {@link 983 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 984 * @param andOperator whether every field must match its keywords, or just 985 one field 986 * @param start the lower bound of the range of templates to return 987 * @param end the upper bound of the range of templates to return (not 988 inclusive) 989 * @param orderByComparator the comparator to order the templates 990 (optionally <code>null</code>) 991 * @return the range of matching templates ordered by the comparator 992 * @throws SystemException if a system exception occurred 993 */ 994 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 995 long companyId, long groupId, long classNameId, long classPK, 996 java.lang.String name, java.lang.String description, 997 java.lang.String type, java.lang.String mode, 998 java.lang.String language, boolean andOperator, int start, int end, 999 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 1000 throws com.liferay.portal.kernel.exception.SystemException { 1001 return getService() 1002 .search(companyId, groupId, classNameId, classPK, name, 1003 description, type, mode, language, andOperator, start, end, 1004 orderByComparator); 1005 } 1006 1007 /** 1008 * Returns an ordered range of all the templates matching the group IDs, 1009 * class Name IDs, class PK, type, and mode, and include the keywords on its 1010 * names and descriptions. 1011 * 1012 * <p> 1013 * Useful when paginating results. Returns a maximum of <code>end - 1014 * start</code> instances. <code>start</code> and <code>end</code> are not 1015 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1016 * refers to the first result in the set. Setting both <code>start</code> 1017 * and <code>end</code> to {@link 1018 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1019 * result set. 1020 * </p> 1021 * 1022 * @param companyId the primary key of the template's company 1023 * @param groupIds the primary keys of the groups 1024 * @param classNameIds the primary keys of the entity's instances the 1025 templates are related to 1026 * @param classPKs the primary keys of the template's related entities 1027 * @param keywords the keywords (space separated), which may occur in the 1028 template's name or description (optionally <code>null</code>) 1029 * @param type the template's type (optionally <code>null</code>). For more 1030 information, see {@link 1031 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1032 * @param mode the template's mode (optionally <code>null</code>). For more 1033 information, see {@link 1034 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1035 * @param start the lower bound of the range of templates to return 1036 * @param end the upper bound of the range of templates to return (not 1037 inclusive) 1038 * @param orderByComparator the comparator to order the templates 1039 (optionally <code>null</code>) 1040 * @return the range of matching templates ordered by the comparator 1041 * @throws SystemException if a system exception occurred 1042 */ 1043 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 1044 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 1045 java.lang.String keywords, java.lang.String type, 1046 java.lang.String mode, int start, int end, 1047 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 1048 throws com.liferay.portal.kernel.exception.SystemException { 1049 return getService() 1050 .search(companyId, groupIds, classNameIds, classPKs, 1051 keywords, type, mode, start, end, orderByComparator); 1052 } 1053 1054 /** 1055 * Returns an ordered range of all the templates matching the group IDs, 1056 * class name IDs, class PK, name keyword, description keyword, type, mode, 1057 * and language. 1058 * 1059 * <p> 1060 * Useful when paginating results. Returns a maximum of <code>end - 1061 * start</code> instances. <code>start</code> and <code>end</code> are not 1062 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1063 * refers to the first result in the set. Setting both <code>start</code> 1064 * and <code>end</code> to {@link 1065 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1066 * result set. 1067 * </p> 1068 * 1069 * @param companyId the primary key of the template's company 1070 * @param groupIds the primary keys of the groups 1071 * @param classNameIds the primary keys of the entity's instances the 1072 templates are related to 1073 * @param classPKs the primary keys of the template's related entities 1074 * @param name the name keywords (optionally <code>null</code>) 1075 * @param description the description keywords (optionally 1076 <code>null</code>) 1077 * @param type the template's type (optionally <code>null</code>). For more 1078 information, see {@link 1079 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1080 * @param mode the template's mode (optionally <code>null</code>). For more 1081 information, see {@link 1082 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1083 * @param language the template's script language (optionally 1084 <code>null</code>). For more information, see {@link 1085 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1086 * @param andOperator whether every field must match its keywords, or just 1087 one field. 1088 * @param start the lower bound of the range of templates to return 1089 * @param end the upper bound of the range of templates to return (not 1090 inclusive) 1091 * @param orderByComparator the comparator to order the templates 1092 (optionally <code>null</code>) 1093 * @return the range of matching templates ordered by the comparator 1094 * @throws SystemException if a system exception occurred 1095 */ 1096 public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search( 1097 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 1098 java.lang.String name, java.lang.String description, 1099 java.lang.String type, java.lang.String mode, 1100 java.lang.String language, boolean andOperator, int start, int end, 1101 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 1102 throws com.liferay.portal.kernel.exception.SystemException { 1103 return getService() 1104 .search(companyId, groupIds, classNameIds, classPKs, name, 1105 description, type, mode, language, andOperator, start, end, 1106 orderByComparator); 1107 } 1108 1109 /** 1110 * Returns the number of templates matching the group, class name ID, class 1111 * PK, type, and matching the keywords in the template names and 1112 * descriptions. 1113 * 1114 * @param companyId the primary key of the template's company 1115 * @param groupId the primary key of the group 1116 * @param classNameId the primary key of the class name for the template's 1117 related model 1118 * @param classPK the primary key of the template's related entity 1119 * @param keywords the keywords (space separated), which may occur in the 1120 template's name or description (optionally <code>null</code>) 1121 * @param type the template's type (optionally <code>null</code>). For more 1122 information, see {@link 1123 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1124 * @param mode the template's mode (optionally <code>null</code>). For more 1125 information, see {@link 1126 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1127 * @return the number of matching templates 1128 * @throws SystemException if a system exception occurred 1129 */ 1130 public static int searchCount(long companyId, long groupId, 1131 long classNameId, long classPK, java.lang.String keywords, 1132 java.lang.String type, java.lang.String mode) 1133 throws com.liferay.portal.kernel.exception.SystemException { 1134 return getService() 1135 .searchCount(companyId, groupId, classNameId, classPK, 1136 keywords, type, mode); 1137 } 1138 1139 /** 1140 * Returns the number of templates matching the group, class name ID, class 1141 * PK, name keyword, description keyword, type, mode, and language. 1142 * 1143 * @param companyId the primary key of the template's company 1144 * @param groupId the primary key of the group 1145 * @param classNameId the primary key of the class name for the template's 1146 related model 1147 * @param classPK the primary key of the template's related entity 1148 * @param name the name keywords (optionally <code>null</code>) 1149 * @param description the description keywords (optionally 1150 <code>null</code>) 1151 * @param type the template's type (optionally <code>null</code>). For more 1152 information, see {@link 1153 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1154 * @param mode the template's mode (optionally <code>null</code>). For more 1155 information, see {@link 1156 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1157 * @param language the template's script language (optionally 1158 <code>null</code>). For more information, see {@link 1159 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1160 * @param andOperator whether every field must match its keywords, or just 1161 one field. 1162 * @return the number of matching templates 1163 * @throws SystemException if a system exception occurred 1164 */ 1165 public static int searchCount(long companyId, long groupId, 1166 long classNameId, long classPK, java.lang.String name, 1167 java.lang.String description, java.lang.String type, 1168 java.lang.String mode, java.lang.String language, boolean andOperator) 1169 throws com.liferay.portal.kernel.exception.SystemException { 1170 return getService() 1171 .searchCount(companyId, groupId, classNameId, classPK, name, 1172 description, type, mode, language, andOperator); 1173 } 1174 1175 /** 1176 * Returns the number of templates matching the group IDs, class name IDs, 1177 * class PK, type, and mode, and matching the keywords in the template names 1178 * and descriptions. 1179 * 1180 * @param companyId the primary key of the template's company 1181 * @param groupIds the primary keys of the groups 1182 * @param classNameIds the primary keys of the entity's instance the 1183 templates are related to 1184 * @param classPKs the primary keys of the template's related entities 1185 * @param keywords the keywords (space separated), which may occur in the 1186 template's name or description (optionally <code>null</code>) 1187 * @param type the template's type (optionally <code>null</code>). For more 1188 information, see {@link 1189 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1190 * @param mode the template's mode (optionally <code>null</code>). For more 1191 information, see {@link 1192 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1193 * @return the number of matching templates 1194 * @throws SystemException if a system exception occurred 1195 */ 1196 public static int searchCount(long companyId, long[] groupIds, 1197 long[] classNameIds, long[] classPKs, java.lang.String keywords, 1198 java.lang.String type, java.lang.String mode) 1199 throws com.liferay.portal.kernel.exception.SystemException { 1200 return getService() 1201 .searchCount(companyId, groupIds, classNameIds, classPKs, 1202 keywords, type, mode); 1203 } 1204 1205 /** 1206 * Returns the number of templates matching the group IDs, class name IDs, 1207 * class PKs, name keyword, description keyword, type, mode, and language. 1208 * 1209 * @param companyId the primary key of the templates company 1210 * @param groupIds the primary keys of the groups 1211 * @param classNameIds the primary keys of the entity's instance the 1212 templates are related to 1213 * @param classPKs the primary keys of the template's related entities 1214 * @param name the name keywords (optionally <code>null</code>) 1215 * @param description the description keywords (optionally 1216 <code>null</code>) 1217 * @param type the template's type (optionally <code>null</code>). For more 1218 information, see {@link 1219 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1220 * @param mode the template's mode (optionally <code>null</code>). For more 1221 information, see {@link 1222 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1223 * @param language the template's script language (optionally 1224 <code>null</code>). For more information, see {@link 1225 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1226 * @param andOperator whether every field must match its keywords, or just 1227 one field. 1228 * @return the number of matching templates 1229 * @throws SystemException if a system exception occurred 1230 */ 1231 public static int searchCount(long companyId, long[] groupIds, 1232 long[] classNameIds, long[] classPKs, java.lang.String name, 1233 java.lang.String description, java.lang.String type, 1234 java.lang.String mode, java.lang.String language, boolean andOperator) 1235 throws com.liferay.portal.kernel.exception.SystemException { 1236 return getService() 1237 .searchCount(companyId, groupIds, classNameIds, classPKs, 1238 name, description, type, mode, language, andOperator); 1239 } 1240 1241 /** 1242 * Updates the template matching the ID. 1243 * 1244 * @param templateId the primary key of the template 1245 * @param classPK the primary key of the template's related entity 1246 * @param nameMap the template's new locales and localized names 1247 * @param descriptionMap the template's new locales and localized 1248 description 1249 * @param type the template's type. For more information, see {@link 1250 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1251 * @param mode the template's mode. For more information, see {@link 1252 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1253 * @param language the template's script language. For more information, 1254 see {@link 1255 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 1256 * @param script the template's script 1257 * @param cacheable whether the template is cacheable 1258 * @param smallImage whether the template has a small image 1259 * @param smallImageURL the template's small image URL (optionally 1260 <code>null</code>) 1261 * @param smallImageFile the template's small image file (optionally 1262 <code>null</code>) 1263 * @param serviceContext the service context to be applied. Can set the 1264 modification date. 1265 * @return the updated template 1266 * @throws PortalException if a portal exception occurred 1267 * @throws SystemException if a system exception occurred 1268 */ 1269 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate( 1270 long templateId, long classPK, 1271 java.util.Map<java.util.Locale, java.lang.String> nameMap, 1272 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1273 java.lang.String type, java.lang.String mode, 1274 java.lang.String language, java.lang.String script, boolean cacheable, 1275 boolean smallImage, java.lang.String smallImageURL, 1276 java.io.File smallImageFile, 1277 com.liferay.portal.service.ServiceContext serviceContext) 1278 throws com.liferay.portal.kernel.exception.PortalException, 1279 com.liferay.portal.kernel.exception.SystemException { 1280 return getService() 1281 .updateTemplate(templateId, classPK, nameMap, 1282 descriptionMap, type, mode, language, script, cacheable, 1283 smallImage, smallImageURL, smallImageFile, serviceContext); 1284 } 1285 1286 public static DDMTemplateLocalService getService() { 1287 if (_service == null) { 1288 _service = (DDMTemplateLocalService)PortalBeanLocatorUtil.locate(DDMTemplateLocalService.class.getName()); 1289 1290 ReferenceRegistry.registerReference(DDMTemplateLocalServiceUtil.class, 1291 "_service"); 1292 } 1293 1294 return _service; 1295 } 1296 1297 /** 1298 * @deprecated As of 6.2.0 1299 */ 1300 public void setService(DDMTemplateLocalService service) { 1301 } 1302 1303 private static DDMTemplateLocalService _service; 1304 }