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