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