001 /** 002 * Copyright (c) 2000-present 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.http; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.log.Log; 020 import com.liferay.portal.kernel.log.LogFactoryUtil; 021 import com.liferay.portal.kernel.util.LocalizationUtil; 022 023 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateServiceUtil; 024 025 import java.rmi.RemoteException; 026 027 import java.util.Locale; 028 import java.util.Map; 029 030 /** 031 * Provides the SOAP utility for the 032 * {@link com.liferay.portlet.dynamicdatamapping.service.DDMTemplateServiceUtil} service utility. The 033 * static methods of this class calls the same methods of the service utility. 034 * However, the signatures are different because it is difficult for SOAP to 035 * support certain types. 036 * 037 * <p> 038 * ServiceBuilder follows certain rules in translating the methods. For example, 039 * if the method in the service utility returns a {@link java.util.List}, that 040 * is translated to an array of {@link com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap}. 041 * If the method in the service utility returns a 042 * {@link com.liferay.portlet.dynamicdatamapping.model.DDMTemplate}, that is translated to a 043 * {@link com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap}. Methods that SOAP cannot 044 * safely wire are skipped. 045 * </p> 046 * 047 * <p> 048 * The benefits of using the SOAP utility is that it is cross platform 049 * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and 050 * even Perl, to call the generated services. One drawback of SOAP is that it is 051 * slow because it needs to serialize all calls into a text format (XML). 052 * </p> 053 * 054 * <p> 055 * You can see a list of services at http://localhost:8080/api/axis. Set the 056 * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure 057 * security. 058 * </p> 059 * 060 * <p> 061 * The SOAP utility is only generated for remote services. 062 * </p> 063 * 064 * @author Brian Wing Shun Chan 065 * @see DDMTemplateServiceHttp 066 * @see com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap 067 * @see com.liferay.portlet.dynamicdatamapping.service.DDMTemplateServiceUtil 068 * @generated 069 */ 070 @ProviderType 071 public class DDMTemplateServiceSoap { 072 /** 073 * Adds a template. 074 * 075 * @param groupId the primary key of the group 076 * @param classNameId the primary key of the class name for template's 077 related model 078 * @param classPK the primary key of the template's related entity 079 * @param nameMap the template's locales and localized names 080 * @param descriptionMap the template's locales and localized descriptions 081 * @param type the template's type. For more information, see {@link 082 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 083 * @param mode the template's mode. For more information, see {@link 084 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 085 * @param language the template's script language. For more information, 086 see {@link 087 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 088 * @param script the template's script 089 * @param serviceContext the service context to be applied. Must have the 090 <code>ddmResource</code> attribute to check permissions. Can set 091 the UUID, creation date, modification date, guest permissions, 092 and group permissions for the template. 093 * @return the template 094 * @throws PortalException if the user did not have permission to add the 095 template or if a portal exception occurred 096 */ 097 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap addTemplate( 098 long groupId, long classNameId, long classPK, 099 java.lang.String[] nameMapLanguageIds, 100 java.lang.String[] nameMapValues, 101 java.lang.String[] descriptionMapLanguageIds, 102 java.lang.String[] descriptionMapValues, java.lang.String type, 103 java.lang.String mode, java.lang.String language, 104 java.lang.String script, 105 com.liferay.portal.service.ServiceContext serviceContext) 106 throws RemoteException { 107 try { 108 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 109 nameMapValues); 110 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 111 descriptionMapValues); 112 113 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 114 DDMTemplateServiceUtil.addTemplate(groupId, classNameId, 115 classPK, nameMap, descriptionMap, type, mode, language, 116 script, serviceContext); 117 118 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 119 } 120 catch (Exception e) { 121 _log.error(e, e); 122 123 throw new RemoteException(e.getMessage()); 124 } 125 } 126 127 /** 128 * Copies the template, creating a new template with all the values 129 * extracted from the original one. This method supports defining a new name 130 * and description. 131 * 132 * @param templateId the primary key of the template to be copied 133 * @param nameMap the new template's locales and localized names 134 * @param descriptionMap the new template's locales and localized 135 descriptions 136 * @param serviceContext the service context to be applied. Must have the 137 <code>ddmResource</code> attribute to check permissions. Can set 138 the UUID, creation date, modification date, guest permissions, 139 and group permissions for the template. 140 * @return the new template 141 * @throws PortalException if the user did not have permission to add the 142 template or if a portal exception occurred 143 */ 144 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap copyTemplate( 145 long templateId, java.lang.String[] nameMapLanguageIds, 146 java.lang.String[] nameMapValues, 147 java.lang.String[] descriptionMapLanguageIds, 148 java.lang.String[] descriptionMapValues, 149 com.liferay.portal.service.ServiceContext serviceContext) 150 throws RemoteException { 151 try { 152 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 153 nameMapValues); 154 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 155 descriptionMapValues); 156 157 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 158 DDMTemplateServiceUtil.copyTemplate(templateId, nameMap, 159 descriptionMap, serviceContext); 160 161 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 162 } 163 catch (Exception e) { 164 _log.error(e, e); 165 166 throw new RemoteException(e.getMessage()); 167 } 168 } 169 170 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap copyTemplate( 171 long templateId, 172 com.liferay.portal.service.ServiceContext serviceContext) 173 throws RemoteException { 174 try { 175 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 176 DDMTemplateServiceUtil.copyTemplate(templateId, serviceContext); 177 178 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 179 } 180 catch (Exception e) { 181 _log.error(e, e); 182 183 throw new RemoteException(e.getMessage()); 184 } 185 } 186 187 /** 188 * Copies all the templates matching the class name ID, class PK, and type. 189 * This method creates new templates, extracting all the values from the old 190 * ones and updating their class PKs. 191 * 192 * @param classNameId the primary key of the class name for template's 193 related model 194 * @param classPK the primary key of the original template's related entity 195 * @param newClassPK the primary key of the new template's related entity 196 * @param type the template's type. For more information, see {@link 197 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 198 * @param serviceContext the service context to be applied. Must have the 199 <code>ddmResource</code> attribute to check permissions. Can set 200 the UUID, creation date, modification date, guest permissions, 201 and group permissions for the template. 202 * @return the new template 203 * @throws PortalException if the user did not have permission to add the 204 template or if a portal exception occurred 205 */ 206 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] copyTemplates( 207 long classNameId, long classPK, long newClassPK, java.lang.String type, 208 com.liferay.portal.service.ServiceContext serviceContext) 209 throws RemoteException { 210 try { 211 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 212 DDMTemplateServiceUtil.copyTemplates(classNameId, classPK, 213 newClassPK, type, serviceContext); 214 215 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 216 } 217 catch (Exception e) { 218 _log.error(e, e); 219 220 throw new RemoteException(e.getMessage()); 221 } 222 } 223 224 /** 225 * Deletes the template and its resources. 226 * 227 * @param templateId the primary key of the template to be deleted 228 * @throws PortalException if the user did not have permission to delete the 229 template or if a portal exception occurred 230 */ 231 public static void deleteTemplate(long templateId) 232 throws RemoteException { 233 try { 234 DDMTemplateServiceUtil.deleteTemplate(templateId); 235 } 236 catch (Exception e) { 237 _log.error(e, e); 238 239 throw new RemoteException(e.getMessage()); 240 } 241 } 242 243 /** 244 * Returns the template matching the group and template key. 245 * 246 * @param groupId the primary key of the group 247 * @param classNameId the primary key of the class name for template's 248 related model 249 * @param templateKey the unique string identifying the template 250 * @return the matching template, or <code>null</code> if a matching 251 template could not be found 252 * @throws PortalException if the user did not have permission to view the 253 template 254 */ 255 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap fetchTemplate( 256 long groupId, long classNameId, java.lang.String templateKey) 257 throws RemoteException { 258 try { 259 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 260 DDMTemplateServiceUtil.fetchTemplate(groupId, classNameId, 261 templateKey); 262 263 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 264 } 265 catch (Exception e) { 266 _log.error(e, e); 267 268 throw new RemoteException(e.getMessage()); 269 } 270 } 271 272 /** 273 * Returns the template with the ID. 274 * 275 * @param templateId the primary key of the template 276 * @return the template with the ID 277 * @throws PortalException if the user did not have permission to view the 278 template or if a matching template could not be found 279 */ 280 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap getTemplate( 281 long templateId) throws RemoteException { 282 try { 283 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 284 DDMTemplateServiceUtil.getTemplate(templateId); 285 286 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 287 } 288 catch (Exception e) { 289 _log.error(e, e); 290 291 throw new RemoteException(e.getMessage()); 292 } 293 } 294 295 /** 296 * Returns the template matching the group and template key. 297 * 298 * @param groupId the primary key of the group 299 * @param classNameId the primary key of the class name for template's 300 related model 301 * @param templateKey the unique string identifying the template 302 * @return the matching template 303 * @throws PortalException if a matching template could not be found 304 */ 305 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap getTemplate( 306 long groupId, long classNameId, java.lang.String templateKey) 307 throws RemoteException { 308 try { 309 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 310 DDMTemplateServiceUtil.getTemplate(groupId, classNameId, 311 templateKey); 312 313 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 314 } 315 catch (Exception e) { 316 _log.error(e, e); 317 318 throw new RemoteException(e.getMessage()); 319 } 320 } 321 322 /** 323 * Returns the template matching the group and template key, optionally 324 * searching ancestor sites (that have sharing enabled) and global scoped 325 * sites. 326 * 327 * <p> 328 * This method first searches in the group. If the template is still not 329 * found and <code>includeAncestorTemplates</code> is set to 330 * <code>true</code>, this method searches the group's ancestor sites (that 331 * have sharing enabled) and lastly searches global scoped sites. 332 * </p> 333 * 334 * @param groupId the primary key of the group 335 * @param classNameId the primary key of the class name for template's 336 related model 337 * @param templateKey the unique string identifying the template 338 * @param includeAncestorTemplates whether to include ancestor sites (that 339 have sharing enabled) and include global scoped sites in the 340 search 341 * @return the matching template 342 * @throws PortalException if a matching template could not be found 343 */ 344 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap getTemplate( 345 long groupId, long classNameId, java.lang.String templateKey, 346 boolean includeAncestorTemplates) throws RemoteException { 347 try { 348 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 349 DDMTemplateServiceUtil.getTemplate(groupId, classNameId, 350 templateKey, includeAncestorTemplates); 351 352 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 353 } 354 catch (Exception e) { 355 _log.error(e, e); 356 357 throw new RemoteException(e.getMessage()); 358 } 359 } 360 361 /** 362 * Returns all the templates matching the group and class name ID. 363 * 364 * @param groupId the primary key of the group 365 * @param classNameId the primary key of the class name for template's 366 related model 367 * @return the matching templates 368 */ 369 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates( 370 long groupId, long classNameId) throws RemoteException { 371 try { 372 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 373 DDMTemplateServiceUtil.getTemplates(groupId, classNameId); 374 375 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 376 } 377 catch (Exception e) { 378 _log.error(e, e); 379 380 throw new RemoteException(e.getMessage()); 381 } 382 } 383 384 /** 385 * Returns all the templates matching the group, class name ID, and class 386 * PK. 387 * 388 * @param groupId the primary key of the group 389 * @param classNameId the primary key of the class name for template's 390 related model 391 * @param classPK the primary key of the template's related entity 392 * @return the matching templates 393 */ 394 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates( 395 long groupId, long classNameId, long classPK) throws RemoteException { 396 try { 397 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 398 DDMTemplateServiceUtil.getTemplates(groupId, classNameId, 399 classPK); 400 401 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 402 } 403 catch (Exception e) { 404 _log.error(e, e); 405 406 throw new RemoteException(e.getMessage()); 407 } 408 } 409 410 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates( 411 long groupId, long classNameId, long classPK, 412 boolean includeAncestorTemplates) throws RemoteException { 413 try { 414 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 415 DDMTemplateServiceUtil.getTemplates(groupId, classNameId, 416 classPK, includeAncestorTemplates); 417 418 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 419 } 420 catch (Exception e) { 421 _log.error(e, e); 422 423 throw new RemoteException(e.getMessage()); 424 } 425 } 426 427 /** 428 * Returns all the templates matching the class name ID, class PK, type, and 429 * mode. 430 * 431 * @param groupId the primary key of the group 432 * @param classNameId the primary key of the class name for template's 433 related model 434 * @param classPK the primary key of the template's related entity 435 * @param type the template's type. For more information, see {@link 436 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 437 * @return the matching templates 438 */ 439 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates( 440 long groupId, long classNameId, long classPK, java.lang.String type) 441 throws RemoteException { 442 try { 443 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 444 DDMTemplateServiceUtil.getTemplates(groupId, classNameId, 445 classPK, type); 446 447 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 448 } 449 catch (Exception e) { 450 _log.error(e, e); 451 452 throw new RemoteException(e.getMessage()); 453 } 454 } 455 456 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplates( 457 long groupId, long classNameId, long classPK, java.lang.String type, 458 java.lang.String mode) throws RemoteException { 459 try { 460 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 461 DDMTemplateServiceUtil.getTemplates(groupId, classNameId, 462 classPK, type, mode); 463 464 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 465 } 466 catch (Exception e) { 467 _log.error(e, e); 468 469 throw new RemoteException(e.getMessage()); 470 } 471 } 472 473 /** 474 * Returns all the templates matching the group and class PK. 475 * 476 * @param groupId the primary key of the group 477 * @param classPK the primary key of the template's related entity 478 * @return the matching templates 479 */ 480 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplatesByClassPK( 481 long groupId, long classPK) throws RemoteException { 482 try { 483 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 484 DDMTemplateServiceUtil.getTemplatesByClassPK(groupId, classPK); 485 486 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 487 } 488 catch (Exception e) { 489 _log.error(e, e); 490 491 throw new RemoteException(e.getMessage()); 492 } 493 } 494 495 /** 496 * Returns an ordered range of all the templates matching the group and 497 * structure class name ID and all the generic templates matching the group. 498 * 499 * <p> 500 * Useful when paginating results. Returns a maximum of <code>end - 501 * start</code> instances. <code>start</code> and <code>end</code> are not 502 * primary keys, they are indexes in the result set. Thus, <code>0</code> 503 * refers to the first result in the set. Setting both <code>start</code> 504 * and <code>end</code> to {@link 505 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 506 * result set. 507 * </p> 508 * 509 * @param groupId the primary key of the group 510 * @param structureClassNameId the primary key of the class name for the 511 template's related structure (optionally <code>0</code>). Specify 512 <code>0</code> to return generic templates only. 513 * @param start the lower bound of the range of templates to return 514 * @param end the upper bound of the range of templates to return (not 515 inclusive) 516 * @param orderByComparator the comparator to order the templates 517 (optionally <code>null</code>) 518 * @return the range of matching templates ordered by the comparator 519 */ 520 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] getTemplatesByStructureClassNameId( 521 long groupId, long structureClassNameId, int start, int end, 522 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator) 523 throws RemoteException { 524 try { 525 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 526 DDMTemplateServiceUtil.getTemplatesByStructureClassNameId(groupId, 527 structureClassNameId, start, end, orderByComparator); 528 529 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 530 } 531 catch (Exception e) { 532 _log.error(e, e); 533 534 throw new RemoteException(e.getMessage()); 535 } 536 } 537 538 /** 539 * Returns the number of templates matching the group and structure class 540 * name ID plus the number of generic templates matching the group. 541 * 542 * @param groupId the primary key of the group 543 * @param structureClassNameId the primary key of the class name for the 544 template's related structure (optionally <code>0</code>). Specify 545 <code>0</code> to count generic templates only. 546 * @return the number of matching templates plus the number of matching 547 generic templates 548 */ 549 public static int getTemplatesByStructureClassNameIdCount(long groupId, 550 long structureClassNameId) throws RemoteException { 551 try { 552 int returnValue = DDMTemplateServiceUtil.getTemplatesByStructureClassNameIdCount(groupId, 553 structureClassNameId); 554 555 return returnValue; 556 } 557 catch (Exception e) { 558 _log.error(e, e); 559 560 throw new RemoteException(e.getMessage()); 561 } 562 } 563 564 /** 565 * Returns an ordered range of all the templates matching the group, class 566 * name ID, class PK, type, and mode, and matching the keywords in the 567 * template names and descriptions. 568 * 569 * <p> 570 * Useful when paginating results. Returns a maximum of <code>end - 571 * start</code> instances. <code>start</code> and <code>end</code> are not 572 * primary keys, they are indexes in the result set. Thus, <code>0</code> 573 * refers to the first result in the set. Setting both <code>start</code> 574 * and <code>end</code> to {@link 575 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 576 * result set. 577 * </p> 578 * 579 * @param companyId the primary key of the template's company 580 * @param groupId the primary key of the group 581 * @param classNameId the primary key of the class name for template's 582 related model 583 * @param classPK the primary key of the template's related entity 584 * @param keywords the keywords (space separated), which may occur in the 585 template's name or description (optionally <code>null</code>) 586 * @param type the template's type (optionally <code>null</code>). For more 587 information, see {@link 588 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 589 * @param mode the template's mode (optionally <code>null</code>) For more 590 information, see {@link 591 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 592 * @param start the lower bound of the range of templates to return 593 * @param end the upper bound of the range of templates to return (not 594 inclusive) 595 * @param orderByComparator the comparator to order the templates 596 (optionally <code>null</code>) 597 * @return the matching templates ordered by the comparator 598 */ 599 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search( 600 long companyId, long groupId, long classNameId, long classPK, 601 java.lang.String keywords, java.lang.String type, 602 java.lang.String mode, int start, int end, 603 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator) 604 throws RemoteException { 605 try { 606 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 607 DDMTemplateServiceUtil.search(companyId, groupId, classNameId, 608 classPK, keywords, type, mode, start, end, orderByComparator); 609 610 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 611 } 612 catch (Exception e) { 613 _log.error(e, e); 614 615 throw new RemoteException(e.getMessage()); 616 } 617 } 618 619 /** 620 * Returns an ordered range of all the templates matching the group, class 621 * name ID, class PK, name keyword, description keyword, type, mode, and 622 * language. 623 * 624 * <p> 625 * Useful when paginating results. Returns a maximum of <code>end - 626 * start</code> instances. <code>start</code> and <code>end</code> are not 627 * primary keys, they are indexes in the result set. Thus, <code>0</code> 628 * refers to the first result in the set. Setting both <code>start</code> 629 * and <code>end</code> to {@link 630 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 631 * result set. 632 * </p> 633 * 634 * @param companyId the primary key of the template's company 635 * @param groupId the primary key of the group 636 * @param classNameId the primary key of the class name for template's 637 related model 638 * @param classPK the primary key of the template's related entity 639 * @param name the name keywords (optionally <code>null</code>) 640 * @param description the description keywords (optionally 641 <code>null</code>) 642 * @param type the template's type (optionally <code>null</code>). For more 643 information, see {@link 644 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 645 * @param mode the template's mode (optionally <code>null</code>). For more 646 information, see {@link 647 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 648 * @param language the template's script language (optionally 649 <code>null</code>). For more information, see {@link 650 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 651 * @param andOperator whether every field must match its keywords, or just 652 one field. 653 * @param start the lower bound of the range of templates to return 654 * @param end the upper bound of the range of templates to return (not 655 inclusive) 656 * @param orderByComparator the comparator to order the templates 657 (optionally <code>null</code>) 658 * @return the matching templates ordered by the comparator 659 */ 660 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search( 661 long companyId, long groupId, long classNameId, long classPK, 662 java.lang.String name, java.lang.String description, 663 java.lang.String type, java.lang.String mode, 664 java.lang.String language, boolean andOperator, int start, int end, 665 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator) 666 throws RemoteException { 667 try { 668 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 669 DDMTemplateServiceUtil.search(companyId, groupId, classNameId, 670 classPK, name, description, type, mode, language, 671 andOperator, start, end, orderByComparator); 672 673 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 674 } 675 catch (Exception e) { 676 _log.error(e, e); 677 678 throw new RemoteException(e.getMessage()); 679 } 680 } 681 682 /** 683 * Returns an ordered range of all the templates matching the group IDs, 684 * class name IDs, class PK, type, and mode, and matching the keywords in 685 * the template names and descriptions. 686 * 687 * <p> 688 * Useful when paginating results. Returns a maximum of <code>end - 689 * start</code> instances. <code>start</code> and <code>end</code> are not 690 * primary keys, they are indexes in the result set. Thus, <code>0</code> 691 * refers to the first result in the set. Setting both <code>start</code> 692 * and <code>end</code> to {@link 693 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 694 * result set. 695 * </p> 696 * 697 * @param companyId the primary key of the template's company 698 * @param groupIds the primary keys of the groups 699 * @param classNameIds the primary keys of the entity's instances the 700 templates are related to 701 * @param classPKs the primary keys of the template's related entities 702 * @param keywords the keywords (space separated), which may occur in the 703 template's name or description (optionally <code>null</code>) 704 * @param type the template's type (optionally <code>null</code>). For more 705 information, see {@link 706 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 707 * @param mode the template's mode (optionally <code>null</code>). For more 708 information, see {@link 709 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 710 * @param start the lower bound of the range of templates to return 711 * @param end the upper bound of the range of templates to return (not 712 inclusive) 713 * @param orderByComparator the comparator to order the templates 714 (optionally <code>null</code>) 715 * @return the matching templates ordered by the comparator 716 */ 717 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search( 718 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 719 java.lang.String keywords, java.lang.String type, 720 java.lang.String mode, int start, int end, 721 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator) 722 throws RemoteException { 723 try { 724 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 725 DDMTemplateServiceUtil.search(companyId, groupIds, 726 classNameIds, classPKs, keywords, type, mode, start, end, 727 orderByComparator); 728 729 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 730 } 731 catch (Exception e) { 732 _log.error(e, e); 733 734 throw new RemoteException(e.getMessage()); 735 } 736 } 737 738 /** 739 * Returns an ordered range of all the templates matching the group IDs, 740 * class name IDs, class PK, name keyword, description keyword, type, mode, 741 * and language. 742 * 743 * <p> 744 * Useful when paginating results. Returns a maximum of <code>end - 745 * start</code> instances. <code>start</code> and <code>end</code> are not 746 * primary keys, they are indexes in the result set. Thus, <code>0</code> 747 * refers to the first result in the set. Setting both <code>start</code> 748 * and <code>end</code> to {@link 749 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 750 * result set. 751 * </p> 752 * 753 * @param companyId the primary key of the template's company 754 * @param groupIds the primary keys of the groups 755 * @param classNameIds the primary keys of the entity's instances the 756 templates are related to 757 * @param classPKs the primary keys of the template's related entities 758 * @param name the name keywords (optionally <code>null</code>) 759 * @param description the description keywords (optionally 760 <code>null</code>) 761 * @param type the template's type (optionally <code>null</code>). For more 762 information, see {@link 763 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 764 * @param mode the template's mode (optionally <code>null</code>). For more 765 information, see {@link 766 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 767 * @param language the template's script language (optionally 768 <code>null</code>). For more information, see {@link 769 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 770 * @param andOperator whether every field must match its keywords, or just 771 one field. 772 * @param start the lower bound of the range of templates to return 773 * @param end the upper bound of the range of templates to return (not 774 inclusive) 775 * @param orderByComparator the comparator to order the templates 776 (optionally <code>null</code>) 777 * @return the matching templates ordered by the comparator 778 */ 779 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap[] search( 780 long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, 781 java.lang.String name, java.lang.String description, 782 java.lang.String type, java.lang.String mode, 783 java.lang.String language, boolean andOperator, int start, int end, 784 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> orderByComparator) 785 throws RemoteException { 786 try { 787 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> returnValue = 788 DDMTemplateServiceUtil.search(companyId, groupIds, 789 classNameIds, classPKs, name, description, type, mode, 790 language, andOperator, start, end, orderByComparator); 791 792 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModels(returnValue); 793 } 794 catch (Exception e) { 795 _log.error(e, e); 796 797 throw new RemoteException(e.getMessage()); 798 } 799 } 800 801 /** 802 * Returns the number of templates matching the group, class name ID, class 803 * PK, type, and mode, and matching the keywords in the template names and 804 * descriptions. 805 * 806 * @param companyId the primary key of the template's company 807 * @param groupId the primary key of the group 808 * @param classNameId the primary key of the class name for template's 809 related model 810 * @param classPK the primary key of the template's related entity 811 * @param keywords the keywords (space separated), which may occur in the 812 template's name or description (optionally <code>null</code>) 813 * @param type the template's type (optionally <code>null</code>). For more 814 information, see {@link 815 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 816 * @param mode the template's mode (optionally <code>null</code>). For more 817 information, see {@link 818 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 819 * @return the number of matching templates 820 */ 821 public static int searchCount(long companyId, long groupId, 822 long classNameId, long classPK, java.lang.String keywords, 823 java.lang.String type, java.lang.String mode) throws RemoteException { 824 try { 825 int returnValue = DDMTemplateServiceUtil.searchCount(companyId, 826 groupId, classNameId, classPK, keywords, type, mode); 827 828 return returnValue; 829 } 830 catch (Exception e) { 831 _log.error(e, e); 832 833 throw new RemoteException(e.getMessage()); 834 } 835 } 836 837 /** 838 * Returns the number of templates matching the group, class name ID, class 839 * PK, name keyword, description keyword, type, mode, and language. 840 * 841 * @param companyId the primary key of the template's company 842 * @param groupId the primary key of the group 843 * @param classNameId the primary key of the class name for template's 844 related model 845 * @param classPK the primary key of the template's related entity 846 * @param name the name keywords (optionally <code>null</code>) 847 * @param description the description keywords (optionally 848 <code>null</code>) 849 * @param type the template's type (optionally <code>null</code>). For more 850 information, see {@link 851 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 852 * @param mode the template's mode (optionally <code>null</code>). For more 853 information, see {@link 854 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 855 * @param language the template's script language (optionally 856 <code>null</code>). For more information, see {@link 857 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 858 * @param andOperator whether every field must match its keywords, or just 859 one field. 860 * @return the number of matching templates 861 */ 862 public static int searchCount(long companyId, long groupId, 863 long classNameId, long classPK, java.lang.String name, 864 java.lang.String description, java.lang.String type, 865 java.lang.String mode, java.lang.String language, boolean andOperator) 866 throws RemoteException { 867 try { 868 int returnValue = DDMTemplateServiceUtil.searchCount(companyId, 869 groupId, classNameId, classPK, name, description, type, 870 mode, language, andOperator); 871 872 return returnValue; 873 } 874 catch (Exception e) { 875 _log.error(e, e); 876 877 throw new RemoteException(e.getMessage()); 878 } 879 } 880 881 /** 882 * Returns the number of templates matching the group IDs, class name IDs, 883 * class PK, type, and mode, and matching the keywords in the template names 884 * and descriptions. 885 * 886 * @param companyId the primary key of the template's company 887 * @param groupIds the primary keys of the groups 888 * @param classNameIds the primary keys of the entity's instances the 889 templates are related to 890 * @param classPKs the primary keys of the template's related entities 891 * @param keywords the keywords (space separated), which may occur in the 892 template's name or description (optionally <code>null</code>) 893 * @param type the template's type (optionally <code>null</code>). For more 894 information, see {@link 895 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 896 * @param mode the template's mode (optionally <code>null</code>). For more 897 information, see {@link 898 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 899 * @return the number of matching templates 900 */ 901 public static int searchCount(long companyId, long[] groupIds, 902 long[] classNameIds, long[] classPKs, java.lang.String keywords, 903 java.lang.String type, java.lang.String mode) throws RemoteException { 904 try { 905 int returnValue = DDMTemplateServiceUtil.searchCount(companyId, 906 groupIds, classNameIds, classPKs, keywords, type, mode); 907 908 return returnValue; 909 } 910 catch (Exception e) { 911 _log.error(e, e); 912 913 throw new RemoteException(e.getMessage()); 914 } 915 } 916 917 /** 918 * Returns the number of templates matching the group IDs, class name IDs, 919 * class PK, name keyword, description keyword, type, mode, and language. 920 * 921 * @param companyId the primary key of the template's company 922 * @param groupIds the primary keys of the groups 923 * @param classNameIds the primary keys of the entity's instances the 924 templates are related to 925 * @param classPKs the primary keys of the template's related entities 926 * @param name the name keywords (optionally <code>null</code>) 927 * @param description the description keywords (optionally 928 <code>null</code>) 929 * @param type the template's type (optionally <code>null</code>). For more 930 information, see {@link 931 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 932 * @param mode the template's mode (optionally <code>null</code>). For more 933 information, see {@link 934 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 935 * @param language the template's script language (optionally 936 <code>null</code>). For more information, see {@link 937 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 938 * @param andOperator whether every field must match its keywords, or just 939 one field. 940 * @return the number of matching templates 941 */ 942 public static int searchCount(long companyId, long[] groupIds, 943 long[] classNameIds, long[] classPKs, java.lang.String name, 944 java.lang.String description, java.lang.String type, 945 java.lang.String mode, java.lang.String language, boolean andOperator) 946 throws RemoteException { 947 try { 948 int returnValue = DDMTemplateServiceUtil.searchCount(companyId, 949 groupIds, classNameIds, classPKs, name, description, type, 950 mode, language, andOperator); 951 952 return returnValue; 953 } 954 catch (Exception e) { 955 _log.error(e, e); 956 957 throw new RemoteException(e.getMessage()); 958 } 959 } 960 961 /** 962 * Updates the template matching the ID. 963 * 964 * @param templateId the primary key of the template 965 * @param classPK the primary key of the template's related entity 966 * @param nameMap the template's new locales and localized names 967 * @param descriptionMap the template's new locales and localized 968 description 969 * @param type the template's type. For more information, see {@link 970 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 971 * @param mode the template's mode. For more information, see {@link 972 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 973 * @param language the template's script language. For more information, 974 see {@link 975 com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}. 976 * @param script the template's script 977 * @param cacheable whether the template is cacheable 978 * @param serviceContext the service context to be applied. Can set the 979 modification date. 980 * @return the updated template 981 * @throws PortalException if the user did not have permission to update the 982 template or if a portal exception occurred 983 */ 984 public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap updateTemplate( 985 long templateId, long classPK, java.lang.String[] nameMapLanguageIds, 986 java.lang.String[] nameMapValues, 987 java.lang.String[] descriptionMapLanguageIds, 988 java.lang.String[] descriptionMapValues, java.lang.String type, 989 java.lang.String mode, java.lang.String language, 990 java.lang.String script, boolean cacheable, 991 com.liferay.portal.service.ServiceContext serviceContext) 992 throws RemoteException { 993 try { 994 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 995 nameMapValues); 996 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 997 descriptionMapValues); 998 999 com.liferay.portlet.dynamicdatamapping.model.DDMTemplate returnValue = 1000 DDMTemplateServiceUtil.updateTemplate(templateId, classPK, 1001 nameMap, descriptionMap, type, mode, language, script, 1002 cacheable, serviceContext); 1003 1004 return com.liferay.portlet.dynamicdatamapping.model.DDMTemplateSoap.toSoapModel(returnValue); 1005 } 1006 catch (Exception e) { 1007 _log.error(e, e); 1008 1009 throw new RemoteException(e.getMessage()); 1010 } 1011 } 1012 1013 private static Log _log = LogFactoryUtil.getLog(DDMTemplateServiceSoap.class); 1014 }