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