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