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;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    import com.liferay.portal.security.ac.AccessControlled;
026    import com.liferay.portal.service.BaseService;
027    
028    /**
029     * Provides the remote service interface for DDMStructure. Methods of this
030     * service are expected to have security checks based on the propagated JAAS
031     * credentials because this service can be accessed remotely.
032     *
033     * @author Brian Wing Shun Chan
034     * @see DDMStructureServiceUtil
035     * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMStructureServiceBaseImpl
036     * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureServiceImpl
037     * @generated
038     */
039    @ProviderType
040    @AccessControlled
041    @JSONWebService
042    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
043            PortalException.class, SystemException.class})
044    public interface DDMStructureService extends BaseService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link DDMStructureServiceUtil} to access the d d m structure remote service. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050    
051            /**
052            * Returns the Spring bean ID for this bean.
053            *
054            * @return the Spring bean ID for this bean
055            */
056            public java.lang.String getBeanIdentifier();
057    
058            /**
059            * Sets the Spring bean ID for this bean.
060            *
061            * @param beanIdentifier the Spring bean ID for this bean
062            */
063            public void setBeanIdentifier(java.lang.String beanIdentifier);
064    
065            /**
066            * Adds a structure referencing a default parent structure, using the portal
067            * property <code>dynamic.data.lists.storage.type</code> storage type and
068            * default structure type.
069            *
070            * @param userId the primary key of the structure's creator/owner
071            * @param groupId the primary key of the group
072            * @param classNameId the primary key of the class name for the structure's
073            related model
074            * @param nameMap the structure's locales and localized names
075            * @param descriptionMap the structure's locales and localized descriptions
076            * @param xsd the structure's XML schema definition
077            * @param serviceContext the service context to be applied. Can set the
078            UUID, creation date, modification date, guest permissions, and
079            group permissions for the structure.
080            * @return the structure
081            * @throws PortalException if a user with the primary key could not be
082            found, if the user did not have permission to add the structure,
083            if the XSD was not well-formed, or if a portal exception occurred
084            * @throws SystemException if a system exception occurred
085            */
086            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure(
087                    long userId, long groupId, long classNameId,
088                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
089                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
090                    java.lang.String xsd,
091                    com.liferay.portal.service.ServiceContext serviceContext)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException;
094    
095            /**
096            * Adds a structure referencing its parent structure.
097            *
098            * @param groupId the primary key of the group
099            * @param parentStructureId the primary key of the parent structure
100            (optionally {@link
101            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants#DEFAULT_PARENT_STRUCTURE_ID})
102            * @param classNameId the primary key of the class name for the structure's
103            related model
104            * @param structureKey the unique string identifying the structure
105            (optionally <code>null</code>)
106            * @param nameMap the structure's locales and localized names
107            * @param descriptionMap the structure's locales and localized descriptions
108            * @param xsd the structure's XML schema definition
109            * @param storageType the structure's storage type. It can be "xml" or
110            "expando". For more information, see {@link
111            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
112            * @param type the structure's type. For more information, see {@link
113            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
114            * @param serviceContext the service context to be applied. Can set the
115            UUID, creation date, modification date, guest permissions, and
116            group permissions for the structure.
117            * @return the structure
118            * @throws PortalException if the user did not have permission to add the
119            structure, if the XSD is not well formed, or if a portal
120            exception occurred
121            * @throws SystemException if a system exception occurred
122            */
123            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure(
124                    long groupId, long parentStructureId, long classNameId,
125                    java.lang.String structureKey,
126                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
127                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
128                    java.lang.String xsd, java.lang.String storageType, int type,
129                    com.liferay.portal.service.ServiceContext serviceContext)
130                    throws com.liferay.portal.kernel.exception.PortalException,
131                            com.liferay.portal.kernel.exception.SystemException;
132    
133            /**
134            * Adds a structure referencing the parent structure by its structure key.
135            * In case the parent structure is not found, it uses the default parent
136            * structure ID.
137            *
138            * @param userId the primary key of the structure's creator/owner
139            * @param groupId the primary key of the group
140            * @param parentStructureKey the unique string identifying the structure
141            * @param classNameId the primary key of the class name for the structure's
142            related model
143            * @param structureKey unique string identifying the structure (optionally
144            <code>null</code>)
145            * @param nameMap the structure's locales and localized names
146            * @param descriptionMap the structure's locales and localized descriptions
147            * @param xsd the XML schema definition of the structure
148            * @param storageType the storage type of the structure. It can be XML or
149            expando. For more information, see {@link
150            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
151            * @param type the structure's type. For more information, see {@link
152            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
153            * @param serviceContext the service context to be applied. Must have the
154            <code>ddmResource</code> attribute to check permissions. Can set
155            the UUID, creation date, modification date, guest permissions,
156            and group permissions for the structure.
157            * @return the structure
158            * @throws PortalException if a user with the primary key could not be
159            found, if the user did not have permission to add the structure,
160            if the XSD was not well-formed, or if a portal exception occurred
161            * @throws SystemException if a system exception occurred
162            */
163            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure(
164                    long userId, long groupId, java.lang.String parentStructureKey,
165                    long classNameId, java.lang.String structureKey,
166                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
167                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
168                    java.lang.String xsd, java.lang.String storageType, int type,
169                    com.liferay.portal.service.ServiceContext serviceContext)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException;
172    
173            /**
174            * Copies a structure, creating a new structure with all the values
175            * extracted from the original one. The new structure supports a new name
176            * and description.
177            *
178            * @param structureId the primary key of the structure to be copied
179            * @param nameMap the new structure's locales and localized names
180            * @param descriptionMap the new structure's locales and localized
181            descriptions
182            * @param serviceContext the service context to be applied. Can set the
183            UUID, creation date, modification date, guest permissions, and
184            group permissions for the structure.
185            * @return the new structure
186            * @throws PortalException if the user did not have permission to add the
187            structure or if a portal exception occurred
188            * @throws SystemException if a system exception occurred
189            */
190            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure copyStructure(
191                    long structureId,
192                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
193                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
194                    com.liferay.portal.service.ServiceContext serviceContext)
195                    throws com.liferay.portal.kernel.exception.PortalException,
196                            com.liferay.portal.kernel.exception.SystemException;
197    
198            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure copyStructure(
199                    long structureId,
200                    com.liferay.portal.service.ServiceContext serviceContext)
201                    throws com.liferay.portal.kernel.exception.PortalException,
202                            com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Deletes the structure and its resources.
206            *
207            * <p>
208            * Before deleting the structure, the system verifies whether the structure
209            * is required by another entity. If it is needed, an exception is thrown.
210            * </p>
211            *
212            * @param structureId the primary key of the structure to be deleted
213            * @throws PortalException if the user did not have permission to delete the
214            structure or if a portal exception occurred
215            * @throws SystemException if a system exception occurred
216            */
217            public void deleteStructure(long structureId)
218                    throws com.liferay.portal.kernel.exception.PortalException,
219                            com.liferay.portal.kernel.exception.SystemException;
220    
221            /**
222            * Returns the structure matching the class name ID, structure key, and
223            * group.
224            *
225            * @param groupId the primary key of the group
226            * @param classNameId the primary key of the class name for the structure's
227            related model
228            * @param structureKey the unique string identifying the structure
229            * @return the matching structure, or <code>null</code> if a matching
230            structure could not be found
231            * @throws PortalException if the user did not have permission to view the
232            structure or if a portal exception occurred
233            * @throws SystemException if a system exception occurred
234            */
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure fetchStructure(
237                    long groupId, long classNameId, java.lang.String structureKey)
238                    throws com.liferay.portal.kernel.exception.PortalException,
239                            com.liferay.portal.kernel.exception.SystemException;
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure fetchStructure(
243                    long groupId, long classNameId, java.lang.String structureKey,
244                    boolean includeAncestorStructures)
245                    throws com.liferay.portal.kernel.exception.PortalException,
246                            com.liferay.portal.kernel.exception.SystemException;
247    
248            /**
249            * Returns the structure with the ID.
250            *
251            * @param structureId the primary key of the structure
252            * @return the structure with the ID
253            * @throws PortalException if the user did not have permission to view the
254            structure or if a structure with the ID could not be found
255            * @throws SystemException if a system exception occurred
256            */
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
259                    long structureId)
260                    throws com.liferay.portal.kernel.exception.PortalException,
261                            com.liferay.portal.kernel.exception.SystemException;
262    
263            /**
264            * Returns the structure matching the class name ID, structure key, and
265            * group.
266            *
267            * @param groupId the primary key of the structure's group
268            * @param classNameId the primary key of the class name for the structure's
269            related model
270            * @param structureKey the unique string identifying the structure
271            * @return the matching structure
272            * @throws PortalException if the user did not have permission to view the
273            structure or if a matching structure could not be found
274            * @throws SystemException if a system exception occurred
275            */
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
278                    long groupId, long classNameId, java.lang.String structureKey)
279                    throws com.liferay.portal.kernel.exception.PortalException,
280                            com.liferay.portal.kernel.exception.SystemException;
281    
282            /**
283            * Returns the structure matching the class name ID, structure key, and
284            * group, optionally in the global scope.
285            *
286            * <p>
287            * This method first searches in the group. If the structure is still not
288            * found and <code>includeGlobalStructures</code> is set to
289            * <code>true</code>, this method searches the global group.
290            * </p>
291            *
292            * @param groupId the primary key of the structure's group
293            * @param classNameId the primary key of the class name for the structure's
294            related model
295            * @param structureKey the unique string identifying the structure
296            * @param includeGlobalStructures whether to include the global scope in
297            the search
298            * @return the matching structure
299            * @throws PortalException if the user did not have permission to view the
300            structure or if a matching structure could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
305                    long groupId, long classNameId, java.lang.String structureKey,
306                    boolean includeGlobalStructures)
307                    throws com.liferay.portal.kernel.exception.PortalException,
308                            com.liferay.portal.kernel.exception.SystemException;
309    
310            /**
311            * Returns all the structures in the group that the user has permission to
312            * view.
313            *
314            * @param groupId the primary key of the group
315            * @return the structures in the group that the user has permission to view
316            * @throws SystemException if a system exception occurred
317            */
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures(
320                    long groupId)
321                    throws com.liferay.portal.kernel.exception.SystemException;
322    
323            /**
324            * Returns all the structures in the groups that the user has permission to
325            * view.
326            *
327            * @param groupIds the primary key of the groups
328            * @return the structures in the groups that the user has permission to view
329            * @throws SystemException if a system exception occurred
330            */
331            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
332            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures(
333                    long[] groupIds)
334                    throws com.liferay.portal.kernel.exception.SystemException;
335    
336            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
337            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures(
338                    long[] groupIds, long classNameId)
339                    throws com.liferay.portal.kernel.exception.SystemException;
340    
341            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
342            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures(
343                    long[] groupIds, long classNameId, int start, int end)
344                    throws com.liferay.portal.kernel.exception.SystemException;
345    
346            /**
347            * Returns an ordered range of all the structures matching the groups and
348            * class name IDs, and matching the keywords in the structure names and
349            * descriptions.
350            *
351            * <p>
352            * Useful when paginating results. Returns a maximum of <code>end -
353            * start</code> instances. <code>start</code> and <code>end</code> are not
354            * primary keys, they are indexes in the result set. Thus, <code>0</code>
355            * refers to the first result in the set. Setting both <code>start</code>
356            * and <code>end</code> to {@link
357            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
358            * result set.
359            * </p>
360            *
361            * @param companyId the primary key of the structure's company
362            * @param groupIds the primary keys of the groups
363            * @param classNameIds the primary keys of the class names of the models
364            the structures are related to
365            * @param keywords the keywords (space separated), which may occur in the
366            structure's name or description (optionally <code>null</code>)
367            * @param start the lower bound of the range of structures to return
368            * @param end the upper bound of the range of structures to return (not
369            inclusive)
370            * @param orderByComparator the comparator to order the structures
371            (optionally <code>null</code>)
372            * @return the range of matching structures ordered by the comparator
373            * @throws SystemException if a system exception occurred
374            */
375            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
376            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search(
377                    long companyId, long[] groupIds, long[] classNameIds,
378                    java.lang.String keywords, int start, int end,
379                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
380                    throws com.liferay.portal.kernel.exception.SystemException;
381    
382            /**
383            * Returns an ordered range of all the structures matching the groups, class
384            * name IDs, name keyword, description keyword, storage type, and type.
385            *
386            * <p>
387            * Useful when paginating results. Returns a maximum of <code>end -
388            * start</code> instances. <code>start</code> and <code>end</code> are not
389            * primary keys, they are indexes in the result set. Thus, <code>0</code>
390            * refers to the first result in the set. Setting both <code>start</code>
391            * and <code>end</code> to {@link
392            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
393            * result set.
394            * </p>
395            *
396            * @param companyId the primary key of the structure's company
397            * @param groupIds the primary keys of the groups
398            * @param classNameIds the primary keys of the class names of the models
399            the structures are related to
400            * @param name the name keywords
401            * @param description the description keywords
402            * @param storageType the structure's storage type. It can be "xml" or
403            "expando". For more information, see {@link
404            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
405            * @param type the structure's type. For more information, see {@link
406            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
407            * @param andOperator whether every field must match its keywords, or just
408            one field
409            * @param start the lower bound of the range of structures to return
410            * @param end the upper bound of the range of structures to return (not
411            inclusive)
412            * @param orderByComparator the comparator to order the structures
413            (optionally <code>null</code>)
414            * @return the range of matching structures ordered by the comparator
415            * @throws SystemException if a system exception occurred
416            */
417            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
418            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search(
419                    long companyId, long[] groupIds, long[] classNameIds,
420                    java.lang.String name, java.lang.String description,
421                    java.lang.String storageType, int type, boolean andOperator, int start,
422                    int end,
423                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
424                    throws com.liferay.portal.kernel.exception.SystemException;
425    
426            /**
427            * Returns the number of structures matching the groups and class name IDs,
428            * and matching the keywords in the structure names and descriptions.
429            *
430            * @param companyId the primary key of the structure's company
431            * @param groupIds the primary keys of the groups
432            * @param classNameIds the primary keys of the class names of the models
433            the structures are related to
434            * @param keywords the keywords (space separated), which may occur in the
435            structure's name or description (optionally <code>null</code>)
436            * @return the number of matching structures
437            * @throws SystemException if a system exception occurred
438            */
439            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
440            public int searchCount(long companyId, long[] groupIds,
441                    long[] classNameIds, java.lang.String keywords)
442                    throws com.liferay.portal.kernel.exception.SystemException;
443    
444            /**
445            * Returns the number of structures matching the groups, class name IDs,
446            * name keyword, description keyword, storage type, and type
447            *
448            * @param companyId the primary key of the structure's company
449            * @param groupIds the primary keys of the groups
450            * @param classNameIds the primary keys of the class names of the models
451            the structure's are related to
452            * @param name the name keywords
453            * @param description the description keywords
454            * @param storageType the structure's storage type. It can be "xml" or
455            "expando". For more information, see {@link
456            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
457            * @param type the structure's type. For more information, see {@link
458            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
459            * @param andOperator whether every field must match its keywords, or just
460            one field
461            * @return the number of matching structures
462            * @throws SystemException if a system exception occurred
463            */
464            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
465            public int searchCount(long companyId, long[] groupIds,
466                    long[] classNameIds, java.lang.String name,
467                    java.lang.String description, java.lang.String storageType, int type,
468                    boolean andOperator)
469                    throws com.liferay.portal.kernel.exception.SystemException;
470    
471            /**
472            * Updates the structure matching the class name ID, structure key, and
473            * group, replacing its old parent structure, name map, description map, and
474            * XSD with new ones.
475            *
476            * @param groupId the primary key of the group
477            * @param parentStructureId the primary key of the new parent structure
478            * @param classNameId the primary key of the class name for the structure's
479            related model
480            * @param structureKey the unique string identifying the structure
481            * @param nameMap the structure's new locales and localized names
482            * @param descriptionMap the structure's new locales and localized
483            description
484            * @param xsd the structure's new XML schema definition
485            * @param serviceContext the service context to be applied. Can set the
486            modification date.
487            * @return the updated structure
488            * @throws PortalException if the user did not have permission to update the
489            structure or if a portal exception occurred
490            * @throws SystemException if a system exception occurred
491            */
492            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
493                    long groupId, long parentStructureId, long classNameId,
494                    java.lang.String structureKey,
495                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
496                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
497                    java.lang.String xsd,
498                    com.liferay.portal.service.ServiceContext serviceContext)
499                    throws com.liferay.portal.kernel.exception.PortalException,
500                            com.liferay.portal.kernel.exception.SystemException;
501    
502            /**
503            * Updates the structure matching the structure ID, replacing the old parent
504            * structure ID, name map, description map, and XSD with the new values.
505            *
506            * @param structureId the primary key of the structure
507            * @param parentStructureId the new parent structure primary key
508            * @param nameMap the structure's new locales and localized names
509            * @param descriptionMap the structure's new locales and localized
510            description
511            * @param xsd the new XML schema definition of the structure
512            * @param serviceContext the service context to be applied. Can set the
513            modification date.
514            * @return the updated structure
515            * @throws PortalException if the user did not have permission to update the
516            structure or if a portal exception occurred
517            * @throws SystemException if a system exception occurred
518            */
519            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
520                    long structureId, long parentStructureId,
521                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
522                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
523                    java.lang.String xsd,
524                    com.liferay.portal.service.ServiceContext serviceContext)
525                    throws com.liferay.portal.kernel.exception.PortalException,
526                            com.liferay.portal.kernel.exception.SystemException;
527    }