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            /**
242            * Returns the structure with the ID.
243            *
244            * @param structureId the primary key of the structure
245            * @return the structure with the ID
246            * @throws PortalException if the user did not have permission to view the
247            structure or if a structure with the ID could not be found
248            * @throws SystemException if a system exception occurred
249            */
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
252                    long structureId)
253                    throws com.liferay.portal.kernel.exception.PortalException,
254                            com.liferay.portal.kernel.exception.SystemException;
255    
256            /**
257            * Returns the structure matching the class name ID, structure key, and
258            * group.
259            *
260            * @param groupId the primary key of the structure's group
261            * @param classNameId the primary key of the class name for the structure's
262            related model
263            * @param structureKey the unique string identifying the structure
264            * @return the matching structure
265            * @throws PortalException if the user did not have permission to view the
266            structure or if a matching structure could not be found
267            * @throws SystemException if a system exception occurred
268            */
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
271                    long groupId, long classNameId, java.lang.String structureKey)
272                    throws com.liferay.portal.kernel.exception.PortalException,
273                            com.liferay.portal.kernel.exception.SystemException;
274    
275            /**
276            * Returns the structure matching the class name ID, structure key, and
277            * group, optionally in the global scope.
278            *
279            * <p>
280            * This method first searches in the group. If the structure is still not
281            * found and <code>includeGlobalStructures</code> is set to
282            * <code>true</code>, this method searches the global group.
283            * </p>
284            *
285            * @param groupId the primary key of the structure's group
286            * @param classNameId the primary key of the class name for the structure's
287            related model
288            * @param structureKey the unique string identifying the structure
289            * @param includeGlobalStructures whether to include the global scope in
290            the search
291            * @return the matching structure
292            * @throws PortalException if the user did not have permission to view the
293            structure or if a matching structure could not be found
294            * @throws SystemException if a system exception occurred
295            */
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
298                    long groupId, long classNameId, java.lang.String structureKey,
299                    boolean includeGlobalStructures)
300                    throws com.liferay.portal.kernel.exception.PortalException,
301                            com.liferay.portal.kernel.exception.SystemException;
302    
303            /**
304            * Returns all the structures in the group that the user has permission to
305            * view.
306            *
307            * @param groupId the primary key of the group
308            * @return the structures in the group that the user has permission to view
309            * @throws SystemException if a system exception occurred
310            */
311            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures(
313                    long groupId)
314                    throws com.liferay.portal.kernel.exception.SystemException;
315    
316            /**
317            * Returns all the structures in the groups that the user has permission to
318            * view.
319            *
320            * @param groupIds the primary key of the groups
321            * @return the structures in the groups that the user has permission to view
322            * @throws SystemException if a system exception occurred
323            */
324            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> getStructures(
326                    long[] groupIds)
327                    throws com.liferay.portal.kernel.exception.SystemException;
328    
329            /**
330            * Returns an ordered range of all the structures matching the groups and
331            * class name IDs, and matching the keywords in the structure names and
332            * descriptions.
333            *
334            * <p>
335            * Useful when paginating results. Returns a maximum of <code>end -
336            * start</code> instances. <code>start</code> and <code>end</code> are not
337            * primary keys, they are indexes in the result set. Thus, <code>0</code>
338            * refers to the first result in the set. Setting both <code>start</code>
339            * and <code>end</code> to {@link
340            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
341            * result set.
342            * </p>
343            *
344            * @param companyId the primary key of the structure's company
345            * @param groupIds the primary keys of the groups
346            * @param classNameIds the primary keys of the class names of the models
347            the structures are related to
348            * @param keywords the keywords (space separated), which may occur in the
349            structure's name or description (optionally <code>null</code>)
350            * @param start the lower bound of the range of structures to return
351            * @param end the upper bound of the range of structures to return (not
352            inclusive)
353            * @param orderByComparator the comparator to order the structures
354            (optionally <code>null</code>)
355            * @return the range of matching structures ordered by the comparator
356            * @throws SystemException if a system exception occurred
357            */
358            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
359            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search(
360                    long companyId, long[] groupIds, long[] classNameIds,
361                    java.lang.String keywords, int start, int end,
362                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
363                    throws com.liferay.portal.kernel.exception.SystemException;
364    
365            /**
366            * Returns an ordered range of all the structures matching the groups, class
367            * name IDs, name keyword, description keyword, storage type, and type.
368            *
369            * <p>
370            * Useful when paginating results. Returns a maximum of <code>end -
371            * start</code> instances. <code>start</code> and <code>end</code> are not
372            * primary keys, they are indexes in the result set. Thus, <code>0</code>
373            * refers to the first result in the set. Setting both <code>start</code>
374            * and <code>end</code> to {@link
375            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
376            * result set.
377            * </p>
378            *
379            * @param companyId the primary key of the structure's company
380            * @param groupIds the primary keys of the groups
381            * @param classNameIds the primary keys of the class names of the models
382            the structures are related to
383            * @param name the name keywords
384            * @param description the description keywords
385            * @param storageType the structure's storage type. It can be "xml" or
386            "expando". For more information, see {@link
387            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
388            * @param type the structure's type. For more information, see {@link
389            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
390            * @param andOperator whether every field must match its keywords, or just
391            one field
392            * @param start the lower bound of the range of structures to return
393            * @param end the upper bound of the range of structures to return (not
394            inclusive)
395            * @param orderByComparator the comparator to order the structures
396            (optionally <code>null</code>)
397            * @return the range of matching structures ordered by the comparator
398            * @throws SystemException if a system exception occurred
399            */
400            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
401            public java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search(
402                    long companyId, long[] groupIds, long[] classNameIds,
403                    java.lang.String name, java.lang.String description,
404                    java.lang.String storageType, int type, boolean andOperator, int start,
405                    int end,
406                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
407                    throws com.liferay.portal.kernel.exception.SystemException;
408    
409            /**
410            * Returns the number of structures matching the groups and class name IDs,
411            * and matching the keywords in the structure names and descriptions.
412            *
413            * @param companyId the primary key of the structure's company
414            * @param groupIds the primary keys of the groups
415            * @param classNameIds the primary keys of the class names of the models
416            the structures are related to
417            * @param keywords the keywords (space separated), which may occur in the
418            structure's name or description (optionally <code>null</code>)
419            * @return the number of matching structures
420            * @throws SystemException if a system exception occurred
421            */
422            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
423            public int searchCount(long companyId, long[] groupIds,
424                    long[] classNameIds, java.lang.String keywords)
425                    throws com.liferay.portal.kernel.exception.SystemException;
426    
427            /**
428            * Returns the number of structures matching the groups, class name IDs,
429            * name keyword, description keyword, storage type, and type
430            *
431            * @param companyId the primary key of the structure's company
432            * @param groupIds the primary keys of the groups
433            * @param classNameIds the primary keys of the class names of the models
434            the structure's are related to
435            * @param name the name keywords
436            * @param description the description keywords
437            * @param storageType the structure's storage type. It can be "xml" or
438            "expando". For more information, see {@link
439            com.liferay.portlet.dynamicdatamapping.storage.StorageType}.
440            * @param type the structure's type. For more information, see {@link
441            com.liferay.portlet.dynamicdatamapping.model.DDMStructureConstants}.
442            * @param andOperator whether every field must match its keywords, or just
443            one field
444            * @return the number of matching structures
445            * @throws SystemException if a system exception occurred
446            */
447            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
448            public int searchCount(long companyId, long[] groupIds,
449                    long[] classNameIds, java.lang.String name,
450                    java.lang.String description, java.lang.String storageType, int type,
451                    boolean andOperator)
452                    throws com.liferay.portal.kernel.exception.SystemException;
453    
454            /**
455            * Updates the structure matching the class name ID, structure key, and
456            * group, replacing its old parent structure, name map, description map, and
457            * XSD with new ones.
458            *
459            * @param groupId the primary key of the group
460            * @param parentStructureId the primary key of the new parent structure
461            * @param classNameId the primary key of the class name for the structure's
462            related model
463            * @param structureKey the unique string identifying the structure
464            * @param nameMap the structure's new locales and localized names
465            * @param descriptionMap the structure's new locales and localized
466            description
467            * @param xsd the structure's new XML schema definition
468            * @param serviceContext the service context to be applied. Can set the
469            modification date.
470            * @return the updated structure
471            * @throws PortalException if the user did not have permission to update the
472            structure or if a portal exception occurred
473            * @throws SystemException if a system exception occurred
474            */
475            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
476                    long groupId, long parentStructureId, long classNameId,
477                    java.lang.String structureKey,
478                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
479                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
480                    java.lang.String xsd,
481                    com.liferay.portal.service.ServiceContext serviceContext)
482                    throws com.liferay.portal.kernel.exception.PortalException,
483                            com.liferay.portal.kernel.exception.SystemException;
484    
485            /**
486            * Updates the structure matching the structure ID, replacing the old parent
487            * structure ID, name map, description map, and XSD with the new values.
488            *
489            * @param structureId the primary key of the structure
490            * @param parentStructureId the new parent structure primary key
491            * @param nameMap the structure's new locales and localized names
492            * @param descriptionMap the structure's new locales and localized
493            description
494            * @param xsd the new XML schema definition of the structure
495            * @param serviceContext the service context to be applied. Can set the
496            modification date.
497            * @return the updated structure
498            * @throws PortalException if the user did not have permission to update the
499            structure or if a portal exception occurred
500            * @throws SystemException if a system exception occurred
501            */
502            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
503                    long structureId, long parentStructureId,
504                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
505                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
506                    java.lang.String xsd,
507                    com.liferay.portal.service.ServiceContext serviceContext)
508                    throws com.liferay.portal.kernel.exception.PortalException,
509                            com.liferay.portal.kernel.exception.SystemException;
510    }