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.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.DDMStructureServiceUtil; 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.DDMStructureServiceUtil} 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.DDMStructureSoap}. 041 * If the method in the service utility returns a 042 * {@link com.liferay.portlet.dynamicdatamapping.model.DDMStructure}, that is translated to a 043 * {@link com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap}. 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 DDMStructureServiceHttp 066 * @see com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap 067 * @see com.liferay.portlet.dynamicdatamapping.service.DDMStructureServiceUtil 068 * @generated 069 */ 070 @ProviderType 071 public class DDMStructureServiceSoap { 072 /** 073 * Adds a structure referencing a default parent structure, using the portal 074 * property <code>dynamic.data.lists.storage.type</code> storage type and 075 * default structure type. 076 * 077 * @param userId the primary key of the structure's creator/owner 078 * @param groupId the primary key of the group 079 * @param classNameId the primary key of the class name for the structure's 080 related model 081 * @param nameMap the structure's locales and localized names 082 * @param descriptionMap the structure's locales and localized descriptions 083 * @param xsd the structure's XML schema definition 084 * @param serviceContext the service context to be applied. Can set the 085 UUID, creation date, modification date, guest permissions, and 086 group permissions for the structure. 087 * @return the structure 088 * @throws PortalException if a user with the primary key could not be 089 found, if the user did not have permission to add the structure, 090 if the XSD was not well-formed, or if a portal exception occurred 091 * @throws SystemException if a system exception occurred 092 */ 093 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap addStructure( 094 long userId, long groupId, long classNameId, 095 java.lang.String[] nameMapLanguageIds, 096 java.lang.String[] nameMapValues, 097 java.lang.String[] descriptionMapLanguageIds, 098 java.lang.String[] descriptionMapValues, java.lang.String xsd, 099 com.liferay.portal.service.ServiceContext serviceContext) 100 throws RemoteException { 101 try { 102 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 103 nameMapValues); 104 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 105 descriptionMapValues); 106 107 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 108 DDMStructureServiceUtil.addStructure(userId, groupId, 109 classNameId, nameMap, descriptionMap, xsd, serviceContext); 110 111 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 112 } 113 catch (Exception e) { 114 _log.error(e, e); 115 116 throw new RemoteException(e.getMessage()); 117 } 118 } 119 120 /** 121 * Adds a structure referencing its parent structure. 122 * 123 * @param groupId the primary key of the group 124 * @param parentStructureId the primary key of the parent structure 125 (optionally {@link 126 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants#DEFAULT_PARENT_STRUCTURE_ID}) 127 * @param classNameId the primary key of the class name for the structure's 128 related model 129 * @param structureKey the unique string identifying the structure 130 (optionally <code>null</code>) 131 * @param nameMap the structure's locales and localized names 132 * @param descriptionMap the structure's locales and localized descriptions 133 * @param xsd the structure's XML schema definition 134 * @param storageType the structure's storage type. It can be "xml" or 135 "expando". For more information, see {@link 136 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 137 * @param type the structure's type. For more information, see {@link 138 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 139 * @param serviceContext the service context to be applied. Can set the 140 UUID, creation date, modification date, guest permissions, and 141 group permissions for the structure. 142 * @return the structure 143 * @throws PortalException if the user did not have permission to add the 144 structure, if the XSD is not well formed, or if a portal 145 exception occurred 146 * @throws SystemException if a system exception occurred 147 */ 148 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap addStructure( 149 long groupId, long parentStructureId, long classNameId, 150 java.lang.String structureKey, java.lang.String[] nameMapLanguageIds, 151 java.lang.String[] nameMapValues, 152 java.lang.String[] descriptionMapLanguageIds, 153 java.lang.String[] descriptionMapValues, java.lang.String xsd, 154 java.lang.String storageType, int type, 155 com.liferay.portal.service.ServiceContext serviceContext) 156 throws RemoteException { 157 try { 158 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 159 nameMapValues); 160 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 161 descriptionMapValues); 162 163 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 164 DDMStructureServiceUtil.addStructure(groupId, 165 parentStructureId, classNameId, structureKey, nameMap, 166 descriptionMap, xsd, storageType, type, serviceContext); 167 168 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 169 } 170 catch (Exception e) { 171 _log.error(e, e); 172 173 throw new RemoteException(e.getMessage()); 174 } 175 } 176 177 /** 178 * Adds a structure referencing the parent structure by its structure key. 179 * In case the parent structure is not found, it uses the default parent 180 * structure ID. 181 * 182 * @param userId the primary key of the structure's creator/owner 183 * @param groupId the primary key of the group 184 * @param parentStructureKey the unique string identifying the structure 185 * @param classNameId the primary key of the class name for the structure's 186 related model 187 * @param structureKey unique string identifying the structure (optionally 188 <code>null</code>) 189 * @param nameMap the structure's locales and localized names 190 * @param descriptionMap the structure's locales and localized descriptions 191 * @param xsd the XML schema definition of the structure 192 * @param storageType the storage type of the structure. It can be XML or 193 expando. For more information, see {@link 194 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 195 * @param type the structure's type. For more information, see {@link 196 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 197 * @param serviceContext the service context to be applied. Must have the 198 <code>ddmResource</code> attribute to check permissions. Can set 199 the UUID, creation date, modification date, guest permissions, 200 and group permissions for the structure. 201 * @return the structure 202 * @throws PortalException if a user with the primary key could not be 203 found, if the user did not have permission to add the structure, 204 if the XSD was not well-formed, or if a portal exception occurred 205 * @throws SystemException if a system exception occurred 206 */ 207 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap addStructure( 208 long userId, long groupId, java.lang.String parentStructureKey, 209 long classNameId, java.lang.String structureKey, 210 java.lang.String[] nameMapLanguageIds, 211 java.lang.String[] nameMapValues, 212 java.lang.String[] descriptionMapLanguageIds, 213 java.lang.String[] descriptionMapValues, java.lang.String xsd, 214 java.lang.String storageType, int type, 215 com.liferay.portal.service.ServiceContext serviceContext) 216 throws RemoteException { 217 try { 218 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 219 nameMapValues); 220 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 221 descriptionMapValues); 222 223 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 224 DDMStructureServiceUtil.addStructure(userId, groupId, 225 parentStructureKey, classNameId, structureKey, nameMap, 226 descriptionMap, xsd, storageType, type, serviceContext); 227 228 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 229 } 230 catch (Exception e) { 231 _log.error(e, e); 232 233 throw new RemoteException(e.getMessage()); 234 } 235 } 236 237 /** 238 * Copies a structure, creating a new structure with all the values 239 * extracted from the original one. The new structure supports a new name 240 * and description. 241 * 242 * @param structureId the primary key of the structure to be copied 243 * @param nameMap the new structure's locales and localized names 244 * @param descriptionMap the new structure's locales and localized 245 descriptions 246 * @param serviceContext the service context to be applied. Can set the 247 UUID, creation date, modification date, guest permissions, and 248 group permissions for the structure. 249 * @return the new structure 250 * @throws PortalException if the user did not have permission to add the 251 structure or if a portal exception occurred 252 * @throws SystemException if a system exception occurred 253 */ 254 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap copyStructure( 255 long structureId, java.lang.String[] nameMapLanguageIds, 256 java.lang.String[] nameMapValues, 257 java.lang.String[] descriptionMapLanguageIds, 258 java.lang.String[] descriptionMapValues, 259 com.liferay.portal.service.ServiceContext serviceContext) 260 throws RemoteException { 261 try { 262 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 263 nameMapValues); 264 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 265 descriptionMapValues); 266 267 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 268 DDMStructureServiceUtil.copyStructure(structureId, nameMap, 269 descriptionMap, serviceContext); 270 271 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 272 } 273 catch (Exception e) { 274 _log.error(e, e); 275 276 throw new RemoteException(e.getMessage()); 277 } 278 } 279 280 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap copyStructure( 281 long structureId, 282 com.liferay.portal.service.ServiceContext serviceContext) 283 throws RemoteException { 284 try { 285 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 286 DDMStructureServiceUtil.copyStructure(structureId, 287 serviceContext); 288 289 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 290 } 291 catch (Exception e) { 292 _log.error(e, e); 293 294 throw new RemoteException(e.getMessage()); 295 } 296 } 297 298 /** 299 * Deletes the structure and its resources. 300 * 301 * <p> 302 * Before deleting the structure, the system verifies whether the structure 303 * is required by another entity. If it is needed, an exception is thrown. 304 * </p> 305 * 306 * @param structureId the primary key of the structure to be deleted 307 * @throws PortalException if the user did not have permission to delete the 308 structure or if a portal exception occurred 309 * @throws SystemException if a system exception occurred 310 */ 311 public static void deleteStructure(long structureId) 312 throws RemoteException { 313 try { 314 DDMStructureServiceUtil.deleteStructure(structureId); 315 } 316 catch (Exception e) { 317 _log.error(e, e); 318 319 throw new RemoteException(e.getMessage()); 320 } 321 } 322 323 /** 324 * Returns the structure matching the class name ID, structure key, and 325 * group. 326 * 327 * @param groupId the primary key of the group 328 * @param classNameId the primary key of the class name for the structure's 329 related model 330 * @param structureKey the unique string identifying the structure 331 * @return the matching structure, or <code>null</code> if a matching 332 structure could not be found 333 * @throws PortalException if the user did not have permission to view the 334 structure or if a portal exception occurred 335 * @throws SystemException if a system exception occurred 336 */ 337 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap fetchStructure( 338 long groupId, long classNameId, java.lang.String structureKey) 339 throws RemoteException { 340 try { 341 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 342 DDMStructureServiceUtil.fetchStructure(groupId, classNameId, 343 structureKey); 344 345 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 346 } 347 catch (Exception e) { 348 _log.error(e, e); 349 350 throw new RemoteException(e.getMessage()); 351 } 352 } 353 354 /** 355 * Returns the structure with the ID. 356 * 357 * @param structureId the primary key of the structure 358 * @return the structure with the ID 359 * @throws PortalException if the user did not have permission to view the 360 structure or if a structure with the ID could not be found 361 * @throws SystemException if a system exception occurred 362 */ 363 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure( 364 long structureId) throws RemoteException { 365 try { 366 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 367 DDMStructureServiceUtil.getStructure(structureId); 368 369 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 370 } 371 catch (Exception e) { 372 _log.error(e, e); 373 374 throw new RemoteException(e.getMessage()); 375 } 376 } 377 378 /** 379 * Returns the structure matching the class name ID, structure key, and 380 * group. 381 * 382 * @param groupId the primary key of the structure's group 383 * @param classNameId the primary key of the class name for the structure's 384 related model 385 * @param structureKey the unique string identifying the structure 386 * @return the matching structure 387 * @throws PortalException if the user did not have permission to view the 388 structure or if a matching structure could not be found 389 * @throws SystemException if a system exception occurred 390 */ 391 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure( 392 long groupId, long classNameId, java.lang.String structureKey) 393 throws RemoteException { 394 try { 395 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 396 DDMStructureServiceUtil.getStructure(groupId, classNameId, 397 structureKey); 398 399 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 400 } 401 catch (Exception e) { 402 _log.error(e, e); 403 404 throw new RemoteException(e.getMessage()); 405 } 406 } 407 408 /** 409 * Returns the structure matching the class name ID, structure key, and 410 * group, optionally in the global scope. 411 * 412 * <p> 413 * This method first searches in the group. If the structure is still not 414 * found and <code>includeGlobalStructures</code> is set to 415 * <code>true</code>, this method searches the global group. 416 * </p> 417 * 418 * @param groupId the primary key of the structure's group 419 * @param classNameId the primary key of the class name for the structure's 420 related model 421 * @param structureKey the unique string identifying the structure 422 * @param includeGlobalStructures whether to include the global scope in 423 the search 424 * @return the matching structure 425 * @throws PortalException if the user did not have permission to view the 426 structure or if a matching structure could not be found 427 * @throws SystemException if a system exception occurred 428 */ 429 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure( 430 long groupId, long classNameId, java.lang.String structureKey, 431 boolean includeGlobalStructures) throws RemoteException { 432 try { 433 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 434 DDMStructureServiceUtil.getStructure(groupId, classNameId, 435 structureKey, includeGlobalStructures); 436 437 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 438 } 439 catch (Exception e) { 440 _log.error(e, e); 441 442 throw new RemoteException(e.getMessage()); 443 } 444 } 445 446 /** 447 * Returns all the structures in the group that the user has permission to 448 * view. 449 * 450 * @param groupId the primary key of the group 451 * @return the structures in the group that the user has permission to view 452 * @throws SystemException if a system exception occurred 453 */ 454 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures( 455 long groupId) throws RemoteException { 456 try { 457 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 458 DDMStructureServiceUtil.getStructures(groupId); 459 460 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 461 } 462 catch (Exception e) { 463 _log.error(e, e); 464 465 throw new RemoteException(e.getMessage()); 466 } 467 } 468 469 /** 470 * Returns all the structures in the groups that the user has permission to 471 * view. 472 * 473 * @param groupIds the primary key of the groups 474 * @return the structures in the groups that the user has permission to view 475 * @throws SystemException if a system exception occurred 476 */ 477 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures( 478 long[] groupIds) throws RemoteException { 479 try { 480 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 481 DDMStructureServiceUtil.getStructures(groupIds); 482 483 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 484 } 485 catch (Exception e) { 486 _log.error(e, e); 487 488 throw new RemoteException(e.getMessage()); 489 } 490 } 491 492 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures( 493 long[] groupIds, long classNameId) throws RemoteException { 494 try { 495 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 496 DDMStructureServiceUtil.getStructures(groupIds, classNameId); 497 498 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 499 } 500 catch (Exception e) { 501 _log.error(e, e); 502 503 throw new RemoteException(e.getMessage()); 504 } 505 } 506 507 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures( 508 long[] groupIds, long classNameId, int start, int end) 509 throws RemoteException { 510 try { 511 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 512 DDMStructureServiceUtil.getStructures(groupIds, classNameId, 513 start, end); 514 515 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 516 } 517 catch (Exception e) { 518 _log.error(e, e); 519 520 throw new RemoteException(e.getMessage()); 521 } 522 } 523 524 /** 525 * Returns an ordered range of all the structures matching the groups and 526 * class name IDs, and matching the keywords in the structure names and 527 * descriptions. 528 * 529 * <p> 530 * Useful when paginating results. Returns a maximum of <code>end - 531 * start</code> instances. <code>start</code> and <code>end</code> are not 532 * primary keys, they are indexes in the result set. Thus, <code>0</code> 533 * refers to the first result in the set. Setting both <code>start</code> 534 * and <code>end</code> to {@link 535 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 536 * result set. 537 * </p> 538 * 539 * @param companyId the primary key of the structure's company 540 * @param groupIds the primary keys of the groups 541 * @param classNameIds the primary keys of the class names of the models 542 the structures are related to 543 * @param keywords the keywords (space separated), which may occur in the 544 structure's name or description (optionally <code>null</code>) 545 * @param start the lower bound of the range of structures to return 546 * @param end the upper bound of the range of structures to return (not 547 inclusive) 548 * @param orderByComparator the comparator to order the structures 549 (optionally <code>null</code>) 550 * @return the range of matching structures ordered by the comparator 551 * @throws SystemException if a system exception occurred 552 */ 553 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search( 554 long companyId, long[] groupIds, long[] classNameIds, 555 java.lang.String keywords, int start, int end, 556 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 557 throws RemoteException { 558 try { 559 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 560 DDMStructureServiceUtil.search(companyId, groupIds, 561 classNameIds, keywords, start, end, orderByComparator); 562 563 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 564 } 565 catch (Exception e) { 566 _log.error(e, e); 567 568 throw new RemoteException(e.getMessage()); 569 } 570 } 571 572 /** 573 * Returns an ordered range of all the structures matching the groups, class 574 * name IDs, name keyword, description keyword, storage type, and type. 575 * 576 * <p> 577 * Useful when paginating results. Returns a maximum of <code>end - 578 * start</code> instances. <code>start</code> and <code>end</code> are not 579 * primary keys, they are indexes in the result set. Thus, <code>0</code> 580 * refers to the first result in the set. Setting both <code>start</code> 581 * and <code>end</code> to {@link 582 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 583 * result set. 584 * </p> 585 * 586 * @param companyId the primary key of the structure's company 587 * @param groupIds the primary keys of the groups 588 * @param classNameIds the primary keys of the class names of the models 589 the structures are related to 590 * @param name the name keywords 591 * @param description the description keywords 592 * @param storageType the structure's storage type. It can be "xml" or 593 "expando". For more information, see {@link 594 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 595 * @param type the structure's type. For more information, see {@link 596 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 597 * @param andOperator whether every field must match its keywords, or just 598 one field 599 * @param start the lower bound of the range of structures to return 600 * @param end the upper bound of the range of structures to return (not 601 inclusive) 602 * @param orderByComparator the comparator to order the structures 603 (optionally <code>null</code>) 604 * @return the range of matching structures ordered by the comparator 605 * @throws SystemException if a system exception occurred 606 */ 607 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search( 608 long companyId, long[] groupIds, long[] classNameIds, 609 java.lang.String name, java.lang.String description, 610 java.lang.String storageType, int type, boolean andOperator, int start, 611 int end, 612 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 613 throws RemoteException { 614 try { 615 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 616 DDMStructureServiceUtil.search(companyId, groupIds, 617 classNameIds, name, description, storageType, type, 618 andOperator, start, end, orderByComparator); 619 620 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 621 } 622 catch (Exception e) { 623 _log.error(e, e); 624 625 throw new RemoteException(e.getMessage()); 626 } 627 } 628 629 /** 630 * Returns the number of structures matching the groups and class name IDs, 631 * and matching the keywords in the structure names and descriptions. 632 * 633 * @param companyId the primary key of the structure's company 634 * @param groupIds the primary keys of the groups 635 * @param classNameIds the primary keys of the class names of the models 636 the structures are related to 637 * @param keywords the keywords (space separated), which may occur in the 638 structure's name or description (optionally <code>null</code>) 639 * @return the number of matching structures 640 * @throws SystemException if a system exception occurred 641 */ 642 public static int searchCount(long companyId, long[] groupIds, 643 long[] classNameIds, java.lang.String keywords) 644 throws RemoteException { 645 try { 646 int returnValue = DDMStructureServiceUtil.searchCount(companyId, 647 groupIds, classNameIds, keywords); 648 649 return returnValue; 650 } 651 catch (Exception e) { 652 _log.error(e, e); 653 654 throw new RemoteException(e.getMessage()); 655 } 656 } 657 658 /** 659 * Returns the number of structures matching the groups, class name IDs, 660 * name keyword, description keyword, storage type, and type 661 * 662 * @param companyId the primary key of the structure's company 663 * @param groupIds the primary keys of the groups 664 * @param classNameIds the primary keys of the class names of the models 665 the structure's are related to 666 * @param name the name keywords 667 * @param description the description keywords 668 * @param storageType the structure's storage type. It can be "xml" or 669 "expando". For more information, see {@link 670 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 671 * @param type the structure's type. For more information, see {@link 672 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 673 * @param andOperator whether every field must match its keywords, or just 674 one field 675 * @return the number of matching structures 676 * @throws SystemException if a system exception occurred 677 */ 678 public static int searchCount(long companyId, long[] groupIds, 679 long[] classNameIds, java.lang.String name, 680 java.lang.String description, java.lang.String storageType, int type, 681 boolean andOperator) throws RemoteException { 682 try { 683 int returnValue = DDMStructureServiceUtil.searchCount(companyId, 684 groupIds, classNameIds, name, description, storageType, 685 type, andOperator); 686 687 return returnValue; 688 } 689 catch (Exception e) { 690 _log.error(e, e); 691 692 throw new RemoteException(e.getMessage()); 693 } 694 } 695 696 /** 697 * Updates the structure matching the class name ID, structure key, and 698 * group, replacing its old parent structure, name map, description map, and 699 * XSD with new ones. 700 * 701 * @param groupId the primary key of the group 702 * @param parentStructureId the primary key of the new parent structure 703 * @param classNameId the primary key of the class name for the structure's 704 related model 705 * @param structureKey the unique string identifying the structure 706 * @param nameMap the structure's new locales and localized names 707 * @param descriptionMap the structure's new locales and localized 708 description 709 * @param xsd the structure's new XML schema definition 710 * @param serviceContext the service context to be applied. Can set the 711 modification date. 712 * @return the updated structure 713 * @throws PortalException if the user did not have permission to update the 714 structure or if a portal exception occurred 715 * @throws SystemException if a system exception occurred 716 */ 717 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure( 718 long groupId, long parentStructureId, long classNameId, 719 java.lang.String structureKey, java.lang.String[] nameMapLanguageIds, 720 java.lang.String[] nameMapValues, 721 java.lang.String[] descriptionMapLanguageIds, 722 java.lang.String[] descriptionMapValues, java.lang.String xsd, 723 com.liferay.portal.service.ServiceContext serviceContext) 724 throws RemoteException { 725 try { 726 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 727 nameMapValues); 728 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 729 descriptionMapValues); 730 731 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 732 DDMStructureServiceUtil.updateStructure(groupId, 733 parentStructureId, classNameId, structureKey, nameMap, 734 descriptionMap, xsd, serviceContext); 735 736 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 737 } 738 catch (Exception e) { 739 _log.error(e, e); 740 741 throw new RemoteException(e.getMessage()); 742 } 743 } 744 745 /** 746 * Updates the structure matching the structure ID, replacing the old parent 747 * structure ID, name map, description map, and XSD with the new values. 748 * 749 * @param structureId the primary key of the structure 750 * @param parentStructureId the new parent structure primary key 751 * @param nameMap the structure's new locales and localized names 752 * @param descriptionMap the structure's new locales and localized 753 description 754 * @param xsd the new XML schema definition of the structure 755 * @param serviceContext the service context to be applied. Can set the 756 modification date. 757 * @return the updated structure 758 * @throws PortalException if the user did not have permission to update the 759 structure or if a portal exception occurred 760 * @throws SystemException if a system exception occurred 761 */ 762 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure( 763 long structureId, long parentStructureId, 764 java.lang.String[] nameMapLanguageIds, 765 java.lang.String[] nameMapValues, 766 java.lang.String[] descriptionMapLanguageIds, 767 java.lang.String[] descriptionMapValues, java.lang.String xsd, 768 com.liferay.portal.service.ServiceContext serviceContext) 769 throws RemoteException { 770 try { 771 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 772 nameMapValues); 773 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 774 descriptionMapValues); 775 776 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 777 DDMStructureServiceUtil.updateStructure(structureId, 778 parentStructureId, nameMap, descriptionMap, xsd, 779 serviceContext); 780 781 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 782 } 783 catch (Exception e) { 784 _log.error(e, e); 785 786 throw new RemoteException(e.getMessage()); 787 } 788 } 789 790 private static Log _log = LogFactoryUtil.getLog(DDMStructureServiceSoap.class); 791 }