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            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap fetchStructure(
355                    long groupId, long classNameId, java.lang.String structureKey,
356                    boolean includeAncestorStructures) throws RemoteException {
357                    try {
358                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
359                                    DDMStructureServiceUtil.fetchStructure(groupId, classNameId,
360                                            structureKey, includeAncestorStructures);
361    
362                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
363                    }
364                    catch (Exception e) {
365                            _log.error(e, e);
366    
367                            throw new RemoteException(e.getMessage());
368                    }
369            }
370    
371            /**
372            * Returns the structure with the ID.
373            *
374            * @param structureId the primary key of the structure
375            * @return the structure with the ID
376            * @throws PortalException if the user did not have permission to view the
377            structure or if a structure with the ID could not be found
378            * @throws SystemException if a system exception occurred
379            */
380            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure(
381                    long structureId) throws RemoteException {
382                    try {
383                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
384                                    DDMStructureServiceUtil.getStructure(structureId);
385    
386                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
387                    }
388                    catch (Exception e) {
389                            _log.error(e, e);
390    
391                            throw new RemoteException(e.getMessage());
392                    }
393            }
394    
395            /**
396            * Returns the structure matching the class name ID, structure key, and
397            * group.
398            *
399            * @param groupId the primary key of the structure's group
400            * @param classNameId the primary key of the class name for the structure's
401            related model
402            * @param structureKey the unique string identifying the structure
403            * @return the matching structure
404            * @throws PortalException if the user did not have permission to view the
405            structure or if a matching structure could not be found
406            * @throws SystemException if a system exception occurred
407            */
408            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure(
409                    long groupId, long classNameId, java.lang.String structureKey)
410                    throws RemoteException {
411                    try {
412                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
413                                    DDMStructureServiceUtil.getStructure(groupId, classNameId,
414                                            structureKey);
415    
416                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
417                    }
418                    catch (Exception e) {
419                            _log.error(e, e);
420    
421                            throw new RemoteException(e.getMessage());
422                    }
423            }
424    
425            /**
426            * Returns the structure matching the class name ID, structure key, and
427            * group, optionally in the global scope.
428            *
429            * <p>
430            * This method first searches in the group. If the structure is still not
431            * found and <code>includeGlobalStructures</code> is set to
432            * <code>true</code>, this method searches the global group.
433            * </p>
434            *
435            * @param groupId the primary key of the structure's group
436            * @param classNameId the primary key of the class name for the structure's
437            related model
438            * @param structureKey the unique string identifying the structure
439            * @param includeGlobalStructures whether to include the global scope in
440            the search
441            * @return the matching structure
442            * @throws PortalException if the user did not have permission to view the
443            structure or if a matching structure could not be found
444            * @throws SystemException if a system exception occurred
445            */
446            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap getStructure(
447                    long groupId, long classNameId, java.lang.String structureKey,
448                    boolean includeGlobalStructures) throws RemoteException {
449                    try {
450                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
451                                    DDMStructureServiceUtil.getStructure(groupId, classNameId,
452                                            structureKey, includeGlobalStructures);
453    
454                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
455                    }
456                    catch (Exception e) {
457                            _log.error(e, e);
458    
459                            throw new RemoteException(e.getMessage());
460                    }
461            }
462    
463            /**
464            * Returns all the structures in the group that the user has permission to
465            * view.
466            *
467            * @param groupId the primary key of the group
468            * @return the structures in the group that the user has permission to view
469            * @throws SystemException if a system exception occurred
470            */
471            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures(
472                    long groupId) throws RemoteException {
473                    try {
474                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
475                                    DDMStructureServiceUtil.getStructures(groupId);
476    
477                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
478                    }
479                    catch (Exception e) {
480                            _log.error(e, e);
481    
482                            throw new RemoteException(e.getMessage());
483                    }
484            }
485    
486            /**
487            * Returns all the structures in the groups that the user has permission to
488            * view.
489            *
490            * @param groupIds the primary key of the groups
491            * @return the structures in the groups that the user has permission to view
492            * @throws SystemException if a system exception occurred
493            */
494            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures(
495                    long[] groupIds) throws RemoteException {
496                    try {
497                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
498                                    DDMStructureServiceUtil.getStructures(groupIds);
499    
500                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
501                    }
502                    catch (Exception e) {
503                            _log.error(e, e);
504    
505                            throw new RemoteException(e.getMessage());
506                    }
507            }
508    
509            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures(
510                    long[] groupIds, long classNameId) throws RemoteException {
511                    try {
512                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
513                                    DDMStructureServiceUtil.getStructures(groupIds, classNameId);
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            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] getStructures(
525                    long[] groupIds, long classNameId, int start, int end)
526                    throws RemoteException {
527                    try {
528                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
529                                    DDMStructureServiceUtil.getStructures(groupIds, classNameId,
530                                            start, end);
531    
532                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
533                    }
534                    catch (Exception e) {
535                            _log.error(e, e);
536    
537                            throw new RemoteException(e.getMessage());
538                    }
539            }
540    
541            /**
542            * Returns an ordered range of all the structures matching the groups and
543            * class name IDs, and matching the keywords in the structure names and
544            * descriptions.
545            *
546            * <p>
547            * Useful when paginating results. Returns a maximum of <code>end -
548            * start</code> instances. <code>start</code> and <code>end</code> are not
549            * primary keys, they are indexes in the result set. Thus, <code>0</code>
550            * refers to the first result in the set. Setting both <code>start</code>
551            * and <code>end</code> to {@link
552            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
553            * result set.
554            * </p>
555            *
556            * @param companyId the primary key of the structure's company
557            * @param groupIds the primary keys of the groups
558            * @param classNameIds the primary keys of the class names of the models
559            the structures are related to
560            * @param keywords the keywords (space separated), which may occur in the
561            structure's name or description (optionally <code>null</code>)
562            * @param start the lower bound of the range of structures to return
563            * @param end the upper bound of the range of structures to return (not
564            inclusive)
565            * @param orderByComparator the comparator to order the structures
566            (optionally <code>null</code>)
567            * @return the range of matching structures ordered by the comparator
568            * @throws SystemException if a system exception occurred
569            */
570            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search(
571                    long companyId, long[] groupIds, long[] classNameIds,
572                    java.lang.String keywords, int start, int end,
573                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
574                    throws RemoteException {
575                    try {
576                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
577                                    DDMStructureServiceUtil.search(companyId, groupIds,
578                                            classNameIds, keywords, start, end, orderByComparator);
579    
580                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
581                    }
582                    catch (Exception e) {
583                            _log.error(e, e);
584    
585                            throw new RemoteException(e.getMessage());
586                    }
587            }
588    
589            /**
590            * Returns an ordered range of all the structures matching the groups, class
591            * name IDs, name keyword, description keyword, storage type, and type.
592            *
593            * <p>
594            * Useful when paginating results. Returns a maximum of <code>end -
595            * start</code> instances. <code>start</code> and <code>end</code> are not
596            * primary keys, they are indexes in the result set. Thus, <code>0</code>
597            * refers to the first result in the set. Setting both <code>start</code>
598            * and <code>end</code> to {@link
599            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
600            * result set.
601            * </p>
602            *
603            * @param companyId the primary key of the structure's company
604            * @param groupIds the primary keys of the groups
605            * @param classNameIds the primary keys of the class names of the models
606            the structures are related to
607            * @param name the name keywords
608            * @param description the description keywords
609            * @param storageType the structure's storage type. It can be "xml" or
610            "expando". For more information, see {@link
611            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
612            * @param type the structure's type. For more information, see {@link
613            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
614            * @param andOperator whether every field must match its keywords, or just
615            one field
616            * @param start the lower bound of the range of structures to return
617            * @param end the upper bound of the range of structures to return (not
618            inclusive)
619            * @param orderByComparator the comparator to order the structures
620            (optionally <code>null</code>)
621            * @return the range of matching structures ordered by the comparator
622            * @throws SystemException if a system exception occurred
623            */
624            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap[] search(
625                    long companyId, long[] groupIds, long[] classNameIds,
626                    java.lang.String name, java.lang.String description,
627                    java.lang.String storageType, int type, boolean andOperator, int start,
628                    int end,
629                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
630                    throws RemoteException {
631                    try {
632                            java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> returnValue =
633                                    DDMStructureServiceUtil.search(companyId, groupIds,
634                                            classNameIds, name, description, storageType, type,
635                                            andOperator, start, end, orderByComparator);
636    
637                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModels(returnValue);
638                    }
639                    catch (Exception e) {
640                            _log.error(e, e);
641    
642                            throw new RemoteException(e.getMessage());
643                    }
644            }
645    
646            /**
647            * Returns the number of structures matching the groups and class name IDs,
648            * and matching the keywords in the structure names and descriptions.
649            *
650            * @param companyId the primary key of the structure's company
651            * @param groupIds the primary keys of the groups
652            * @param classNameIds the primary keys of the class names of the models
653            the structures are related to
654            * @param keywords the keywords (space separated), which may occur in the
655            structure's name or description (optionally <code>null</code>)
656            * @return the number of matching structures
657            * @throws SystemException if a system exception occurred
658            */
659            public static int searchCount(long companyId, long[] groupIds,
660                    long[] classNameIds, java.lang.String keywords)
661                    throws RemoteException {
662                    try {
663                            int returnValue = DDMStructureServiceUtil.searchCount(companyId,
664                                            groupIds, classNameIds, keywords);
665    
666                            return returnValue;
667                    }
668                    catch (Exception e) {
669                            _log.error(e, e);
670    
671                            throw new RemoteException(e.getMessage());
672                    }
673            }
674    
675            /**
676            * Returns the number of structures matching the groups, class name IDs,
677            * name keyword, description keyword, storage type, and type
678            *
679            * @param companyId the primary key of the structure's company
680            * @param groupIds the primary keys of the groups
681            * @param classNameIds the primary keys of the class names of the models
682            the structure's are related to
683            * @param name the name keywords
684            * @param description the description keywords
685            * @param storageType the structure's storage type. It can be "xml" or
686            "expando". For more information, see {@link
687            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
688            * @param type the structure's type. For more information, see {@link
689            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
690            * @param andOperator whether every field must match its keywords, or just
691            one field
692            * @return the number of matching structures
693            * @throws SystemException if a system exception occurred
694            */
695            public static int searchCount(long companyId, long[] groupIds,
696                    long[] classNameIds, java.lang.String name,
697                    java.lang.String description, java.lang.String storageType, int type,
698                    boolean andOperator) throws RemoteException {
699                    try {
700                            int returnValue = DDMStructureServiceUtil.searchCount(companyId,
701                                            groupIds, classNameIds, name, description, storageType,
702                                            type, andOperator);
703    
704                            return 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 class name ID, structure key, and
715            * group, replacing its old parent structure, name map, description map, and
716            * XSD with new ones.
717            *
718            * @param groupId the primary key of the group
719            * @param parentStructureId the primary key of the new parent structure
720            * @param classNameId the primary key of the class name for the structure's
721            related model
722            * @param structureKey the unique string identifying the structure
723            * @param nameMap the structure's new locales and localized names
724            * @param descriptionMap the structure's new locales and localized
725            description
726            * @param xsd the structure's new XML schema definition
727            * @param serviceContext the service context to be applied. Can set the
728            modification date.
729            * @return the updated structure
730            * @throws PortalException if the user did not have permission to update the
731            structure or if a portal exception occurred
732            * @throws SystemException if a system exception occurred
733            */
734            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure(
735                    long groupId, long parentStructureId, long classNameId,
736                    java.lang.String structureKey, java.lang.String[] nameMapLanguageIds,
737                    java.lang.String[] nameMapValues,
738                    java.lang.String[] descriptionMapLanguageIds,
739                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
740                    com.liferay.portal.service.ServiceContext serviceContext)
741                    throws RemoteException {
742                    try {
743                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
744                                            nameMapValues);
745                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
746                                            descriptionMapValues);
747    
748                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
749                                    DDMStructureServiceUtil.updateStructure(groupId,
750                                            parentStructureId, classNameId, structureKey, nameMap,
751                                            descriptionMap, xsd, serviceContext);
752    
753                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
754                    }
755                    catch (Exception e) {
756                            _log.error(e, e);
757    
758                            throw new RemoteException(e.getMessage());
759                    }
760            }
761    
762            /**
763            * Updates the structure matching the structure ID, replacing the old parent
764            * structure ID, name map, description map, and XSD with the new values.
765            *
766            * @param structureId the primary key of the structure
767            * @param parentStructureId the new parent structure primary key
768            * @param nameMap the structure's new locales and localized names
769            * @param descriptionMap the structure's new locales and localized
770            description
771            * @param xsd the new XML schema definition of the structure
772            * @param serviceContext the service context to be applied. Can set the
773            modification date.
774            * @return the updated structure
775            * @throws PortalException if the user did not have permission to update the
776            structure or if a portal exception occurred
777            * @throws SystemException if a system exception occurred
778            */
779            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap updateStructure(
780                    long structureId, long parentStructureId,
781                    java.lang.String[] nameMapLanguageIds,
782                    java.lang.String[] nameMapValues,
783                    java.lang.String[] descriptionMapLanguageIds,
784                    java.lang.String[] descriptionMapValues, java.lang.String xsd,
785                    com.liferay.portal.service.ServiceContext serviceContext)
786                    throws RemoteException {
787                    try {
788                            Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds,
789                                            nameMapValues);
790                            Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
791                                            descriptionMapValues);
792    
793                            com.liferay.portlet.dynamicdatamapping.model.DDMStructure returnValue =
794                                    DDMStructureServiceUtil.updateStructure(structureId,
795                                            parentStructureId, nameMap, descriptionMap, xsd,
796                                            serviceContext);
797    
798                            return com.liferay.portlet.dynamicdatamapping.model.DDMStructureSoap.toSoapModel(returnValue);
799                    }
800                    catch (Exception e) {
801                            _log.error(e, e);
802    
803                            throw new RemoteException(e.getMessage());
804                    }
805            }
806    
807            private static Log _log = LogFactoryUtil.getLog(DDMStructureServiceSoap.class);
808    }