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 /** 493 * Returns an ordered range of all the structures matching the groups and 494 * class name IDs, and matching the keywords in the structure names and 495 * descriptions. 496 * 497 * <p> 498 * Useful when paginating results. Returns a maximum of <code>end - 499 * start</code> instances. <code>start</code> and <code>end</code> are not 500 * primary keys, they are indexes in the result set. Thus, <code>0</code> 501 * refers to the first result in the set. Setting both <code>start</code> 502 * and <code>end</code> to {@link 503 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 504 * result set. 505 * </p> 506 * 507 * @param companyId the primary key of the structure's company 508 * @param groupIds the primary keys of the groups 509 * @param classNameIds the primary keys of the class names of the models 510 the structures are related to 511 * @param keywords the keywords (space separated), which may occur in the 512 structure's name or description (optionally <code>null</code>) 513 * @param start the lower bound of the range of structures to return 514 * @param end the upper bound of the range of structures to return (not 515 inclusive) 516 * @param orderByComparator the comparator to order the structures 517 (optionally <code>null</code>) 518 * @return the range of matching structures ordered by the comparator 519 * @throws SystemException if a system exception occurred 520 */ 521 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search( 522 long companyId, long[] groupIds, long[] classNameIds, 523 java.lang.String keywords, int start, int end, 524 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 525 throws RemoteException { 526 try { 527 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 528 DDMStructureServiceUtil.search(companyId, groupIds, 529 classNameIds, keywords, start, end, orderByComparator); 530 531 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 532 } 533 catch (Exception e) { 534 _log.error(e, e); 535 536 throw new RemoteException(e.getMessage()); 537 } 538 } 539 540 /** 541 * Returns an ordered range of all the structures matching the groups, class 542 * name IDs, name keyword, description keyword, storage type, and type. 543 * 544 * <p> 545 * Useful when paginating results. Returns a maximum of <code>end - 546 * start</code> instances. <code>start</code> and <code>end</code> are not 547 * primary keys, they are indexes in the result set. Thus, <code>0</code> 548 * refers to the first result in the set. Setting both <code>start</code> 549 * and <code>end</code> to {@link 550 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 551 * result set. 552 * </p> 553 * 554 * @param companyId the primary key of the structure's company 555 * @param groupIds the primary keys of the groups 556 * @param classNameIds the primary keys of the class names of the models 557 the structures are related to 558 * @param name the name keywords 559 * @param description the description keywords 560 * @param storageType the structure's storage type. It can be "xml" or 561 "expando". For more information, see {@link 562 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 563 * @param type the structure's type. For more information, see {@link 564 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 565 * @param andOperator whether every field must match its keywords, or just 566 one field 567 * @param start the lower bound of the range of structures to return 568 * @param end the upper bound of the range of structures to return (not 569 inclusive) 570 * @param orderByComparator the comparator to order the structures 571 (optionally <code>null</code>) 572 * @return the range of matching structures ordered by the comparator 573 * @throws SystemException if a system exception occurred 574 */ 575 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search( 576 long companyId, long[] groupIds, long[] classNameIds, 577 java.lang.String name, java.lang.String description, 578 java.lang.String storageType, int type, boolean andOperator, int start, 579 int end, 580 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 581 throws RemoteException { 582 try { 583 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue = 584 DDMStructureServiceUtil.search(companyId, groupIds, 585 classNameIds, name, description, storageType, type, 586 andOperator, start, end, orderByComparator); 587 588 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue); 589 } 590 catch (Exception e) { 591 _log.error(e, e); 592 593 throw new RemoteException(e.getMessage()); 594 } 595 } 596 597 /** 598 * Returns the number of structures matching the groups and class name IDs, 599 * and matching the keywords in the structure names and descriptions. 600 * 601 * @param companyId the primary key of the structure's company 602 * @param groupIds the primary keys of the groups 603 * @param classNameIds the primary keys of the class names of the models 604 the structures are related to 605 * @param keywords the keywords (space separated), which may occur in the 606 structure's name or description (optionally <code>null</code>) 607 * @return the number of matching structures 608 * @throws SystemException if a system exception occurred 609 */ 610 public static int searchCount(long companyId, long[] groupIds, 611 long[] classNameIds, java.lang.String keywords) 612 throws RemoteException { 613 try { 614 int returnValue = DDMStructureServiceUtil.searchCount(companyId, 615 groupIds, classNameIds, keywords); 616 617 return returnValue; 618 } 619 catch (Exception e) { 620 _log.error(e, e); 621 622 throw new RemoteException(e.getMessage()); 623 } 624 } 625 626 /** 627 * Returns the number of structures matching the groups, class name IDs, 628 * name keyword, description keyword, storage type, and type 629 * 630 * @param companyId the primary key of the structure's company 631 * @param groupIds the primary keys of the groups 632 * @param classNameIds the primary keys of the class names of the models 633 the structure's are related to 634 * @param name the name keywords 635 * @param description the description keywords 636 * @param storageType the structure's storage type. It can be "xml" or 637 "expando". For more information, see {@link 638 com.liferay.portlet.dynamicdatamapping.storage.StorageType}. 639 * @param type the structure's type. For more information, see {@link 640 com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}. 641 * @param andOperator whether every field must match its keywords, or just 642 one field 643 * @return the number of matching structures 644 * @throws SystemException if a system exception occurred 645 */ 646 public static int searchCount(long companyId, long[] groupIds, 647 long[] classNameIds, java.lang.String name, 648 java.lang.String description, java.lang.String storageType, int type, 649 boolean andOperator) throws RemoteException { 650 try { 651 int returnValue = DDMStructureServiceUtil.searchCount(companyId, 652 groupIds, classNameIds, name, description, storageType, 653 type, andOperator); 654 655 return returnValue; 656 } 657 catch (Exception e) { 658 _log.error(e, e); 659 660 throw new RemoteException(e.getMessage()); 661 } 662 } 663 664 /** 665 * Updates the structure matching the class name ID, structure key, and 666 * group, replacing its old parent structure, name map, description map, and 667 * XSD with new ones. 668 * 669 * @param groupId the primary key of the group 670 * @param parentStructureId the primary key of the new parent structure 671 * @param classNameId the primary key of the class name for the structure's 672 related model 673 * @param structureKey the unique string identifying the structure 674 * @param nameMap the structure's new locales and localized names 675 * @param descriptionMap the structure's new locales and localized 676 description 677 * @param xsd the structure's new XML schema definition 678 * @param serviceContext the service context to be applied. Can set the 679 modification date. 680 * @return the updated structure 681 * @throws PortalException if the user did not have permission to update the 682 structure or if a portal exception occurred 683 * @throws SystemException if a system exception occurred 684 */ 685 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure( 686 long groupId, long parentStructureId, long classNameId, 687 java.lang.String structureKey, java.lang.String[] nameMapLanguageIds, 688 java.lang.String[] nameMapValues, 689 java.lang.String[] descriptionMapLanguageIds, 690 java.lang.String[] descriptionMapValues, java.lang.String xsd, 691 com.liferay.portal.service.ServiceContext serviceContext) 692 throws RemoteException { 693 try { 694 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 695 nameMapValues); 696 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 697 descriptionMapValues); 698 699 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 700 DDMStructureServiceUtil.updateStructure(groupId, 701 parentStructureId, classNameId, structureKey, nameMap, 702 descriptionMap, xsd, serviceContext); 703 704 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 705 } 706 catch (Exception e) { 707 _log.error(e, e); 708 709 throw new RemoteException(e.getMessage()); 710 } 711 } 712 713 /** 714 * Updates the structure matching the structure ID, replacing the old parent 715 * structure ID, name map, description map, and XSD with the new values. 716 * 717 * @param structureId the primary key of the structure 718 * @param parentStructureId the new parent structure primary key 719 * @param nameMap the structure's new locales and localized names 720 * @param descriptionMap the structure's new locales and localized 721 description 722 * @param xsd the new XML schema definition of the structure 723 * @param serviceContext the service context to be applied. Can set the 724 modification date. 725 * @return the updated structure 726 * @throws PortalException if the user did not have permission to update the 727 structure or if a portal exception occurred 728 * @throws SystemException if a system exception occurred 729 */ 730 public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure( 731 long structureId, long parentStructureId, 732 java.lang.String[] nameMapLanguageIds, 733 java.lang.String[] nameMapValues, 734 java.lang.String[] descriptionMapLanguageIds, 735 java.lang.String[] descriptionMapValues, java.lang.String xsd, 736 com.liferay.portal.service.ServiceContext serviceContext) 737 throws RemoteException { 738 try { 739 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 740 nameMapValues); 741 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 742 descriptionMapValues); 743 744 com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue = 745 DDMStructureServiceUtil.updateStructure(structureId, 746 parentStructureId, nameMap, descriptionMap, xsd, 747 serviceContext); 748 749 return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue); 750 } 751 catch (Exception e) { 752 _log.error(e, e); 753 754 throw new RemoteException(e.getMessage()); 755 } 756 } 757 758 private static Log _log = LogFactoryUtil.getLog(DDMStructureServiceSoap.class); 759 }