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