KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > file > types > I_CmsResourceType


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/file/types/I_CmsResourceType.java,v $
3  * Date : $Date: 2006/03/27 14:52:48 $
4  * Version: $Revision: 1.29 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.file.types;
33
34 import org.opencms.configuration.CmsConfigurationException;
35 import org.opencms.configuration.I_CmsConfigurationParameterHandler;
36 import org.opencms.db.CmsSecurityManager;
37 import org.opencms.file.CmsFile;
38 import org.opencms.file.CmsObject;
39 import org.opencms.file.CmsProperty;
40 import org.opencms.file.CmsResource;
41 import org.opencms.main.CmsException;
42 import org.opencms.main.CmsIllegalArgumentException;
43
44 import java.util.List JavaDoc;
45
46 /**
47  * Defines resource type descriptors for all resources in the VFS.<p>
48  *
49  * Each file in the VFS must belong to an initialized resource type.
50  * The available resource type are read during system startup ftom the configuration
51  * file <code>opencms-vfs.xml</code>.<p>
52  *
53  * Certain resource types may require special handling for certain operations.
54  * This is usually required for write operations, or other operations that
55  * modify the VFS database.
56  * Therefore, the {@link org.opencms.file.CmsObject} defers handling of this
57  * operations to implementations of this interface.<p>
58  *
59  * If you implement a new resource type, it's a good idea to extend the
60  * abstract class {@link org.opencms.file.types.A_CmsResourceType}.<p>
61  *
62  * Important: The {@link org.opencms.file.CmsObject} passes the {@link org.opencms.db.CmsSecurityManager}
63  * object to implementations of this class. Using this object correctly is key to the
64  * resource type operations. Mistakes made in the implementation of a resource type
65  * can screw up the system security and the database structure, and make you unhappy. <p>
66  *
67  * @author Alexander Kandzior
68  * @author Thomas Weckert
69  * @author Michael Emmerich
70  *
71  * @version $Revision: 1.29 $
72  *
73  * @since 6.0.0
74  */

75 public interface I_CmsResourceType extends I_CmsConfigurationParameterHandler {
76
77     /** The name of the addMapping() method. */
78     String JavaDoc ADD_MAPPING_METHOD = "addMappingType";
79
80     /** Name of the addResourceType() method to add a resource type from the configuration. */
81     String JavaDoc ADD_RESOURCE_TYPE_METHOD = "addResourceType";
82
83     /** Configuration key prefix for properties that are attached when creating a new resource. */
84     String JavaDoc CONFIGURATION_PROPERTY_CREATE = "property.create.";
85
86     /** Configuration key for the resource type id. */
87     String JavaDoc CONFIGURATION_RESOURCE_TYPE_ID = "resource.type.id";
88
89     /** Configuration key for the resource type name. */
90     String JavaDoc CONFIGURATION_RESOURCE_TYPE_NAME = "resource.type.name";
91
92     /** Store the property on resource record. */
93     String JavaDoc PROPERTY_ON_RESOURCE = "resource";
94
95     /** Store the property on structure record. */
96     String JavaDoc PROPERTY_ON_STRUCTURE = "structure";
97
98     /**
99      * Maps a file extension to a resource type.<p>
100      *
101      * When uploading files into OpenCms, they must be mapped to the different
102      * OpenCms resource types. The configuration, to map which extension to which
103      * resouce type is done in the OpenCms VFS configuration.
104      *
105      * @param mapping the file extension mapped to the resource type
106      */

107     void addMappingType(String JavaDoc mapping);
108
109     /**
110      * Changes the project id of the resource to the current project, indicating that
111      * the resource was last modified in this project.<p>
112      *
113      * This information is used while publishing. Only resources inside the
114      * project folders that are new/modified/changed <i>and</i> that "belong"
115      * to the project (i.e. have the id of the project set) are published
116      * with the project.<p>
117      *
118      * @param cms the initialized CmsObject
119      * @param securityManager the initialized OpenCms security manager
120      * @param resource the resource to apply this operation to
121      *
122      * @throws CmsException if something goes wrong
123      *
124      * @see CmsObject#changeLastModifiedProjectId(String)
125      * @see CmsSecurityManager#changeLastModifiedProjectId(org.opencms.file.CmsRequestContext, CmsResource)
126      */

127     void changeLastModifiedProjectId(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource)
128     throws CmsException;
129
130     /**
131      * Changes the lock of a resource to the current user,
132      * that is "steals" the lock from another user.<p>
133      *
134      * @param cms the current cms context
135      * @param securityManager the initialized OpenCms security manager
136      * @param resource the name of the resource to change the lock with complete path
137      *
138      * @throws CmsException if something goes wrong
139      *
140      * @see CmsObject#changeLock(String)
141      * @see CmsSecurityManager#changeLock(org.opencms.file.CmsRequestContext, CmsResource)
142      */

143     void changeLock(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource) throws CmsException;
144
145     /**
146      * Changes the resource flags of a resource.<p>
147      *
148      * The resource flags are used to indicate various "special" conditions
149      * for a resource. Most notably, the "internal only" setting which signals
150      * that a resource can not be directly requested with it's URL.<p>
151      *
152      * @param cms the initialized CmsObject
153      * @param securityManager the initialized OpenCms security manager
154      * @param resource the resource to change the flags for
155      * @param flags the new resource flags for this resource
156      *
157      * @throws CmsException if something goes wrong
158      *
159      * @see CmsObject#chflags(String, int)
160      * @see CmsSecurityManager#chflags(org.opencms.file.CmsRequestContext, CmsResource, int)
161      */

162     void chflags(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int flags)
163     throws CmsException;
164
165     /**
166      * Changes the resource type of a resource.<p>
167      *
168      * OpenCms handles resources according to the resource type,
169      * not the file suffix. This is e.g. why a JSP in OpenCms can have the
170      * suffix ".html" instead of ".jsp" only. Changing the resource type
171      * makes sense e.g. if you want to make a plain text file a JSP resource,
172      * or a binary file an image, etc.<p>
173      *
174      * @param cms the initialized CmsObject
175      * @param securityManager the initialized OpenCms security manager
176      * @param resource the resource to change the type for
177      * @param type the new resource type for this resource
178      *
179      * @throws CmsException if something goes wrong
180      *
181      * @see CmsObject#chtype(String, int)
182      * @see CmsSecurityManager#chtype(org.opencms.file.CmsRequestContext, CmsResource, int)
183      */

184     void chtype(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int type) throws CmsException;
185
186     /**
187      * Copies a resource.<p>
188      *
189      * You must ensure that the destination path is an absolute, valid and
190      * existing VFS path. Relative paths from the source are currently not supported.<p>
191      *
192      * The copied resource will always be locked to the current user
193      * after the copy operation.<p>
194      *
195      * In case the target resource already exists, it is overwritten with the
196      * source resource.<p>
197      *
198      * The <code>siblingMode</code> parameter controls how to handle siblings
199      * during the copy operation.<br>
200      * Possible values for this parameter are: <br>
201      * <ul>
202      * <li><code>{@link org.opencms.file.CmsResource#COPY_AS_NEW}</code></li>
203      * <li><code>{@link org.opencms.file.CmsResource#COPY_AS_SIBLING}</code></li>
204      * <li><code>{@link org.opencms.file.CmsResource#COPY_PRESERVE_SIBLING}</code></li>
205      * </ul><p>
206      *
207      * @param cms the initialized CmsObject
208      * @param securityManager the initialized OpenCms security manager
209      * @param source the resource to copy
210      * @param destination the name of the copy destination with complete path
211      * @param siblingMode indicates how to handle siblings during copy
212      *
213      * @throws CmsIllegalArgumentException if the <code>destination</code> argument is null or of length 0
214      * @throws CmsException if something goes wrong
215      *
216      * @see CmsObject#copyResource(String, String, int)
217      * @see CmsSecurityManager#copyResource(org.opencms.file.CmsRequestContext, CmsResource, String, int)
218      */

219     void copyResource(
220         CmsObject cms,
221         CmsSecurityManager securityManager,
222         CmsResource source,
223         String JavaDoc destination,
224         int siblingMode) throws CmsException, CmsIllegalArgumentException;
225
226     /**
227      * Copies a resource to the current project of the user.<p>
228      *
229      * This is used to extend the current users project with the
230      * specified resource, in case that the resource is not yet part of the project.
231      * The resource is not really copied like in a regular copy operation,
232      * it is in fact only "enabled" in the current users project.<p>
233      *
234      * @param cms the initialized CmsObject
235      * @param securityManager the initialized OpenCms security manager
236      * @param resource the resource to apply this operation to
237      *
238      * @throws CmsException if something goes wrong
239      * @throws CmsIllegalArgumentException if the <code>resource</code> argument is null or of length 0
240      *
241      * @see CmsObject#copyResourceToProject(String)
242      * @see CmsSecurityManager#copyResourceToProject(org.opencms.file.CmsRequestContext, CmsResource)
243      */

244     void copyResourceToProject(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource)
245     throws CmsException, CmsIllegalArgumentException;
246
247     /**
248      * Creates a new resource of the given resource type
249      * with the provided content and properties.<p>
250      *
251      * @param cms the initialized CmsObject
252      * @param securityManager the initialized OpenCms security manager
253      * @param resourcename the name of the resource to create (full path)
254      * @param content the content for the new resource
255      * @param properties the properties for the new resource
256      *
257      * @return the created resource
258      *
259      * @throws CmsException if something goes wrong
260      * @throws CmsIllegalArgumentException if the <code>source</code> argument is null or of length 0
261      *
262      * @see CmsObject#createResource(String, int, byte[], List)
263      * @see CmsObject#createResource(String, int)
264      * @see CmsSecurityManager#createResource(org.opencms.file.CmsRequestContext, String, int, byte[], List)
265      */

266     CmsResource createResource(
267         CmsObject cms,
268         CmsSecurityManager securityManager,
269         String JavaDoc resourcename,
270         byte[] content,
271         List JavaDoc properties) throws CmsException, CmsIllegalArgumentException;
272
273     /**
274      * Creates a new sibling of the source resource.<p>
275      *
276      * @param cms the current cms context
277      * @param securityManager the initialized OpenCms security manager
278      * @param source the resource to create a sibling for
279      * @param destination the name of the sibling to create with complete path
280      * @param properties the individual properties for the new sibling
281      *
282      * @throws CmsException if something goes wrong
283      *
284      * @see CmsObject#createSibling(String, String, List)
285      * @see CmsSecurityManager#createSibling(org.opencms.file.CmsRequestContext, CmsResource, String, List)
286      */

287     void createSibling(
288         CmsObject cms,
289         CmsSecurityManager securityManager,
290         CmsResource source,
291         String JavaDoc destination,
292         List JavaDoc properties) throws CmsException;
293
294     /**
295      * Deletes a resource given its name.<p>
296      *
297      * The <code>siblingMode</code> parameter controls how to handle siblings
298      * during the delete operation.<br>
299      * Possible values for this parameter are: <br>
300      * <ul>
301      * <li><code>{@link org.opencms.file.CmsResource#DELETE_REMOVE_SIBLINGS}</code></li>
302      * <li><code>{@link org.opencms.file.CmsResource#DELETE_PRESERVE_SIBLINGS}</code></li>
303      * </ul><p>
304      *
305      * @param cms the initialized CmsObject
306      * @param securityManager the initialized OpenCms security manager
307      * @param resource the resource to delete
308      * @param siblingMode indicates how to handle siblings of the deleted resource
309      *
310      * @throws CmsException if something goes wrong
311      *
312      * @see CmsObject#deleteResource(String, int)
313      * @see CmsSecurityManager#deleteResource(org.opencms.file.CmsRequestContext, CmsResource, int)
314      */

315     void deleteResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int siblingMode)
316     throws CmsException;
317
318     /**
319      * Returns the default for the <code>cache</code> property setting of this resource type.<p>
320      *
321      * The <code>cache</code> property is used by the Flex cache implementation
322      * to build the cache key that controls the caching behaviour of a resource.<p>
323      *
324      * If <code>null</code> is returnd, this is the same as turning the cache
325      * off by default for this resource type.<p>
326      *
327      * @return the default for the <code>cache</code> property setting of this resource type
328      *
329      * @see org.opencms.flex.CmsFlexCache
330      * @see org.opencms.flex.CmsFlexCacheKey
331      */

332     String JavaDoc getCachePropertyDefault();
333
334     /**
335      * Returns the class name configured for this resouce type.<p>
336      *
337      * This may be different from the instance class name in case the configured class could not
338      * be instanciated. If the configured class is unavailable, an instance of
339      * <code>{@link CmsResourceTypeUnknown}</code> is used. This enables the import of modules that contain their
340      * own resource types classes (which are not available before the module is fully imnported).<p>
341      *
342      * @return the class name configured for this resouce type
343      */

344     String JavaDoc getClassName();
345
346     /**
347      * Returns the configured copy resources for this resource type in an unmodifiable List.<p>
348      *
349      * @return the configured copy resources for this resource type in an unmodifiable List
350      */

351     List JavaDoc getConfiguredCopyResources();
352
353     /**
354      * Returns the configured default properties for this resource type in an unmodifiable List.<p>
355      *
356      * @return the configured default properties for this resource type in an unmodifiable List
357      */

358     List JavaDoc getConfiguredDefaultProperties();
359
360     /**
361      * Returns the file extensions mappings for this resource type in an unmodifiable List.<p>
362      *
363      * @return a list of file extensions mappings for this resource type in an unmodifiable List
364      */

365     List JavaDoc getConfiguredMappings();
366
367     /**
368      * Returns the loader type id of this resource type.<p>
369      *
370      * @return the loader type id of this resource type
371      */

372     int getLoaderId();
373
374     /**
375      * Returns the type id of this resource type.<p>
376      *
377      * @return the type id of this resource type
378      */

379     int getTypeId();
380
381     /**
382      * Returns the name of this resource type.<p>
383      *
384      * @return the name of this resource type
385      */

386     String JavaDoc getTypeName();
387
388     /**
389      * Imports a resource to the OpenCms VFS.<p>
390      *
391      * If a resource already exists in the VFS (i.e. has the same name and
392      * same id) it is replaced by the imported resource.<p>
393      *
394      * If a resource with the same name but a different id exists,
395      * the imported resource is (usually) moved to the "lost and found" folder.<p>
396      *
397      * @param cms the initialized CmsObject
398      * @param securityManager the initialized OpenCms security manager
399      * @param resourcename the target name (with full path) for the resource after import
400      * @param resource the resource to be imported
401      * @param content the content of the resource
402      * @param properties the properties of the resource
403      *
404      * @return the imported resource
405      *
406      * @throws CmsException if something goes wrong
407      *
408      * @see CmsSecurityManager#moveToLostAndFound(org.opencms.file.CmsRequestContext, String, boolean)
409      * @see CmsObject#importResource(String, CmsResource, byte[], List)
410      * @see CmsSecurityManager#importResource(org.opencms.file.CmsRequestContext, String, CmsResource, byte[], List, boolean)
411      */

412     CmsResource importResource(
413         CmsObject cms,
414         CmsSecurityManager securityManager,
415         String JavaDoc resourcename,
416         CmsResource resource,
417         byte[] content,
418         List JavaDoc properties) throws CmsException;
419
420     /**
421      * Special version of the configuration initialization used with resource types
422      * to set resource type, id and class name, required for the XML configuration.<p>
423      *
424      * <i>Please note:</i> Many resource types defined in the core have in fact
425      * a fixed resource type and a fixed id. Configurable name and id is used only
426      * for certain types.<p>
427      *
428      * The provided named class must implement this interface (<code>{@link I_CmsResourceType}</code>).
429      * Usually the provided class name should be the class name of the resource type instance,
430      * but this may be different in special cases or configuration errors.
431      *
432      * For example, if a module is imported that contains it's own resource type class files,
433      * the included class file are usually not be available until the server is restarted.
434      * If the named class given in the XML configuration (or module manifest.xml) is not available,
435      * or not implementing <code>{@link I_CmsResourceType}</code>,
436      * then <code>{@link CmsResourceTypeUnknown}</code> is used for the resource type instance.<p>
437      *
438      * @param name the resource type name
439      * @param id the resource type id
440      * @param className the class name of the resource type (read from the XML configuration)
441      *
442      * @throws CmsConfigurationException if the configuration is invalid
443      */

444     void initConfiguration(String JavaDoc name, String JavaDoc id, String JavaDoc className) throws CmsConfigurationException;
445
446     /**
447      * Initializes this resource type.<p>
448      *
449      * This method will be called once during the OpenCms
450      * initialization processs. The VFS will already be available
451      * at the time the method is called.<p>
452      *
453      * @param cms a OpenCms context initialized with "Admin" permissions
454      */

455     void initialize(CmsObject cms);
456
457     /**
458      * Indicates that this is an additional resource type which is defined in a module.<p>
459      * @return true or false
460      */

461     boolean isAdditionalModuleResourceType();
462
463     /**
464      * Returns <code>true</code> if this resource type is direct editable.<p>
465      *
466      * @return <code>true</code> if this resource type is direct editable
467      */

468     boolean isDirectEditable();
469
470     /**
471      * Returns <code>true</code> if this resource type is a folder.<p>
472      *
473      * @return <code>true</code> if this resource type is a folder
474      */

475     boolean isFolder();
476
477     /**
478      * Locks a resource.<p>
479      *
480      * The <code>mode</code> parameter controls what kind of lock is used.<br>
481      * Possible values for this parameter are: <br>
482      * <ul>
483      * <li><code>{@link org.opencms.lock.CmsLock#COMMON}</code></li>
484      * <li><code>{@link org.opencms.lock.CmsLock#TEMPORARY}</code></li>
485      * </ul><p>
486      *
487      * @param cms the initialized CmsObject
488      * @param securityManager the initialized OpenCms security manager
489      * @param resource the resource to lock
490      * @param mode flag indicating the mode for the lock
491      *
492      * @throws CmsException if something goes wrong
493      *
494      * @see CmsObject#lockResource(String, int)
495      * @see CmsSecurityManager#lockResource(org.opencms.file.CmsRequestContext, CmsResource, int)
496      */

497     void lockResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int mode)
498     throws CmsException;
499
500     /**
501      * Moves a resource to the given destination.<p>
502      *
503      * A move operation in OpenCms is always a copy (as sibling) followed by a delete,
504      * this is a result of the online/offline structure of the
505      * OpenCms VFS. This way you can see the deleted files/folders in the offline
506      * project, and you will be unable to undelete them.<p>
507      *
508      * @param cms the current cms context
509      * @param securityManager the initialized OpenCms security manager
510      * @param resource the resource to move
511      * @param destination the destination resource name
512      *
513      * @throws CmsException if something goes wrong
514      * @throws CmsIllegalArgumentException if the <code>source</code> argument is null or of length 0
515      *
516      *
517      * @see CmsObject#moveResource(String, String)
518      * @see CmsObject#renameResource(String, String)
519      * @see CmsSecurityManager#copyResource(org.opencms.file.CmsRequestContext, CmsResource, String, int)
520      * @see CmsSecurityManager#deleteResource(org.opencms.file.CmsRequestContext, CmsResource, int)
521      */

522     void moveResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, String JavaDoc destination)
523     throws CmsException, CmsIllegalArgumentException;
524
525     /**
526      * Removes a resource from the current project of the user.<p>
527      *
528      * This is used to reduce the current users project with the
529      * specified resource, in case that the resource is already part of the project.
530      * The resource is not really removed like in a regular copy operation,
531      * it is in fact only "disabled" in the current users project.<p>
532      *
533      * @param cms the initialized CmsObject
534      * @param securityManager the initialized OpenCms security manager
535      * @param resource the resource to apply this operation to
536      *
537      * @throws CmsException if something goes wrong
538      * @throws CmsIllegalArgumentException if the <code>resource</code> argument is null or of length 0
539      *
540      * @see CmsObject#copyResourceToProject(String)
541      * @see CmsSecurityManager#copyResourceToProject(org.opencms.file.CmsRequestContext, CmsResource)
542      */

543     void removeResourceFromProject(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource)
544     throws CmsException, CmsIllegalArgumentException;
545
546     /**
547      * Replaces the content, type and properties of a resource.<p>
548      *
549      * @param cms the current cms context
550      * @param securityManager the initialized OpenCms security manager
551      * @param resource the name of the resource to replace
552      * @param type the new type of the resource
553      * @param content the new content of the resource
554      * @param properties the new properties of the resource
555      *
556      * @throws CmsException if something goes wrong
557      *
558      * @see CmsObject#replaceResource(String, int, byte[], List)
559      * @see CmsSecurityManager#replaceResource(org.opencms.file.CmsRequestContext, CmsResource, int, byte[], List)
560      */

561     void replaceResource(
562         CmsObject cms,
563         CmsSecurityManager securityManager,
564         CmsResource resource,
565         int type,
566         byte[] content,
567         List JavaDoc properties) throws CmsException;
568
569     /**
570      * Restores a file in the current project with a version from the backup archive.<p>
571      *
572      * @param cms the current cms context
573      * @param securityManager the initialized OpenCms security manager
574      * @param resource the resource to restore from the archive
575      * @param tag the tag (version) id to resource form the archive
576      *
577      * @throws CmsException if something goes wrong
578      *
579      * @see CmsObject#restoreResourceBackup(String, int)
580      * @see CmsSecurityManager#restoreResource(org.opencms.file.CmsRequestContext, CmsResource, int)
581      */

582     void restoreResourceBackup(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int tag)
583     throws CmsException;
584
585     /**
586      * Sets the additional resource type flag.<p>
587      * @param additionalType true or false
588      */

589     void setAdditionalModuleResourceType(boolean additionalType);
590
591     /**
592      * Changes the "expire" date of a resource.<p>
593      *
594      * @param cms the current cms context
595      * @param securityManager the initialized OpenCms security manager
596      * @param resource the resource to touch
597      * @param dateExpired the new expire date of the changed resource
598      * @param recursive if this operation is to be applied recursivly to all resources in a folder
599      *
600      * @throws CmsException if something goes wrong
601      *
602      * @see CmsObject#setDateExpired(String, long, boolean)
603      * @see CmsSecurityManager#setDateExpired(org.opencms.file.CmsRequestContext, CmsResource, long)
604      */

605     void setDateExpired(
606         CmsObject cms,
607         CmsSecurityManager securityManager,
608         CmsResource resource,
609         long dateExpired,
610         boolean recursive) throws CmsException;
611
612     /**
613      * Changes the "last modified" date of a resource.<p>
614      *
615      * @param cms the current cms context
616      * @param securityManager the initialized OpenCms security manager
617      * @param resource the resource to touch
618      * @param dateLastModified timestamp the new timestamp of the changed resource
619      * @param recursive if this operation is to be applied recursivly to all resources in a folder
620      *
621      * @throws CmsException if something goes wrong
622      *
623      * @see CmsObject#setDateLastModified(String, long, boolean)
624      * @see CmsSecurityManager#setDateLastModified(org.opencms.file.CmsRequestContext, CmsResource, long)
625      */

626     void setDateLastModified(
627         CmsObject cms,
628         CmsSecurityManager securityManager,
629         CmsResource resource,
630         long dateLastModified,
631         boolean recursive) throws CmsException;
632
633     /**
634      * Changes the "release" date of a resource.<p>
635      *
636      * @param cms the current cms context
637      * @param securityManager the initialized OpenCms security manager
638      * @param resource the resource to touch
639      * @param dateReleased the new release date of the changed resource
640      * @param recursive if this operation is to be applied recursivly to all resources in a folder
641      *
642      * @throws CmsException if something goes wrong
643      *
644      * @see CmsObject#setDateReleased(String, long, boolean)
645      * @see CmsSecurityManager#setDateReleased(org.opencms.file.CmsRequestContext, CmsResource, long)
646      */

647     void setDateReleased(
648         CmsObject cms,
649         CmsSecurityManager securityManager,
650         CmsResource resource,
651         long dateReleased,
652         boolean recursive) throws CmsException;
653
654     /**
655      * Undos all changes in the resource by restoring the version from the
656      * online project to the current offline project.<p>
657      *
658      * This is also used when doing an "undelete" operation.<p>
659      *
660      * @param cms the current cms context
661      * @param securityManager the initialized OpenCms security manager
662      * @param resource the resource to undo the changes for
663      * @param recursive if this operation is to be applied recursivly to all resources in a folder
664      *
665      * @throws CmsException if something goes wrong
666      *
667      * @see CmsObject#undoChanges(String, boolean)
668      * @see CmsSecurityManager#undoChanges(org.opencms.file.CmsRequestContext, CmsResource)
669      */

670     void undoChanges(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, boolean recursive)
671     throws CmsException;
672
673     /**
674      * Unlocks a resource.<p>
675      *
676      * @param cms the current cms context
677      * @param securityManager the initialized OpenCms security manager
678      * @param resource the resource to unlock
679      *
680      * @throws CmsException if something goes wrong
681      *
682      * @see CmsObject#unlockResource(String)
683      * @see CmsSecurityManager#unlockResource(org.opencms.file.CmsRequestContext, CmsResource)
684      */

685     void unlockResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource) throws CmsException;
686
687     /**
688      * Writes a resource, including it's content.<p>
689      *
690      * Applies only to resources of type <code>{@link CmsFile}</code>
691      * that have a binary content attached.<p>
692      *
693      * @param cms the current cms context
694      * @param securityManager the initialized OpenCms security manager
695      * @param resource the resource to apply this operation to
696      *
697      * @return the written resource
698      *
699      * @throws CmsException if something goes wrong
700      *
701      * @see CmsObject#writeFile(CmsFile)
702      * @see CmsSecurityManager#writeFile(org.opencms.file.CmsRequestContext, CmsFile)
703      */

704     CmsFile writeFile(CmsObject cms, CmsSecurityManager securityManager, CmsFile resource) throws CmsException;
705
706     /**
707      * Writes a property for a specified resource.<p>
708      *
709      * @param cms the current cms context
710      * @param securityManager the initialized OpenCms security manager
711      * @param resource the resource to write the property for
712      * @param property the property to write
713      *
714      * @throws CmsException if something goes wrong
715      *
716      * @see CmsObject#writePropertyObject(String, CmsProperty)
717      * @see CmsSecurityManager#writePropertyObject(org.opencms.file.CmsRequestContext, CmsResource, CmsProperty)
718      */

719     void writePropertyObject(
720         CmsObject cms,
721         CmsSecurityManager securityManager,
722         CmsResource resource,
723         CmsProperty property) throws CmsException;
724
725     /**
726      * Writes a list of properties for a specified resource.<p>
727      *
728      * Code calling this method has to ensure that the no properties
729      * <code>a, b</code> are contained in the specified list so that <code>a.equals(b)</code>,
730      * otherwise an exception is thrown.<p>
731      *
732      * @param cms the current cms context
733      * @param securityManager the initialized OpenCms security manager
734      * @param resource the resource to write the properties for
735      * @param properties the list of properties to write
736      *
737      * @throws CmsException if something goes wrong
738      *
739      * @see CmsObject#writePropertyObjects(String, List)
740      * @see CmsSecurityManager#writePropertyObjects(org.opencms.file.CmsRequestContext, CmsResource, List)
741      */

742     void writePropertyObjects(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, List JavaDoc properties)
743     throws CmsException;
744 }
Popular Tags