📄 i_cmsresourcetype.java
字号:
* with the provided content and properties.<p>
*
* @param cms the initialized CmsObject
* @param securityManager the initialized OpenCms security manager
* @param resourcename the name of the resource to create (full path)
* @param content the content for the new resource
* @param properties the properties for the new resource
*
* @return the created resource
*
* @throws CmsException if something goes wrong
* @throws CmsIllegalArgumentException if the <code>source</code> argument is null or of length 0
*
* @see CmsObject#createResource(String, int, byte[], List)
* @see CmsObject#createResource(String, int)
* @see CmsSecurityManager#createResource(org.opencms.file.CmsRequestContext, String, int, byte[], List)
*/
CmsResource createResource(
CmsObject cms,
CmsSecurityManager securityManager,
String resourcename,
byte[] content,
List properties) throws CmsException, CmsIllegalArgumentException;
/**
* Creates a new sibling of the source resource.<p>
*
* @param cms the current cms context
* @param securityManager the initialized OpenCms security manager
* @param source the resource to create a sibling for
* @param destination the name of the sibling to create with complete path
* @param properties the individual properties for the new sibling
*
* @throws CmsException if something goes wrong
*
* @see CmsObject#createSibling(String, String, List)
* @see CmsSecurityManager#createSibling(org.opencms.file.CmsRequestContext, CmsResource, String, List)
*/
void createSibling(
CmsObject cms,
CmsSecurityManager securityManager,
CmsResource source,
String destination,
List properties) throws CmsException;
/**
* Deletes a resource given its name.<p>
*
* The <code>siblingMode</code> parameter controls how to handle siblings
* during the delete operation.<br>
* Possible values for this parameter are: <br>
* <ul>
* <li><code>{@link org.opencms.file.CmsResource#DELETE_REMOVE_SIBLINGS}</code></li>
* <li><code>{@link org.opencms.file.CmsResource#DELETE_PRESERVE_SIBLINGS}</code></li>
* </ul><p>
*
* @param cms the initialized CmsObject
* @param securityManager the initialized OpenCms security manager
* @param resource the resource to delete
* @param siblingMode indicates how to handle siblings of the deleted resource
*
* @throws CmsException if something goes wrong
*
* @see CmsObject#deleteResource(String, int)
* @see CmsSecurityManager#deleteResource(org.opencms.file.CmsRequestContext, CmsResource, int)
*/
void deleteResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int siblingMode)
throws CmsException;
/**
* Returns the default for the <code>cache</code> property setting of this resource type.<p>
*
* The <code>cache</code> property is used by the Flex cache implementation
* to build the cache key that controls the caching behaviour of a resource.<p>
*
* If <code>null</code> is returnd, this is the same as turning the cache
* off by default for this resource type.<p>
*
* @return the default for the <code>cache</code> property setting of this resource type
*
* @see org.opencms.flex.CmsFlexCache
* @see org.opencms.flex.CmsFlexCacheKey
*/
String getCachePropertyDefault();
/**
* Returns the class name configured for this resouce type.<p>
*
* This may be different from the instance class name in case the configured class could not
* be instanciated. If the configured class is unavailable, an instance of
* <code>{@link CmsResourceTypeUnknown}</code> is used. This enables the import of modules that contain their
* own resource types classes (which are not available before the module is fully imnported).<p>
*
* @return the class name configured for this resouce type
*/
String getClassName();
/**
* Returns the configured copy resources for this resource type in an unmodifiable List.<p>
*
* @return the configured copy resources for this resource type in an unmodifiable List
*/
List getConfiguredCopyResources();
/**
* Returns the configured default properties for this resource type in an unmodifiable List.<p>
*
* @return the configured default properties for this resource type in an unmodifiable List
*/
List getConfiguredDefaultProperties();
/**
* Returns the file extensions mappings for this resource type in an unmodifiable List.<p>
*
* @return a list of file extensions mappings for this resource type in an unmodifiable List
*/
List getConfiguredMappings();
/**
* Returns the loader type id of this resource type.<p>
*
* @return the loader type id of this resource type
*/
int getLoaderId();
/**
* Returns the type id of this resource type.<p>
*
* @return the type id of this resource type
*/
int getTypeId();
/**
* Returns the name of this resource type.<p>
*
* @return the name of this resource type
*/
String getTypeName();
/**
* Imports a resource to the OpenCms VFS.<p>
*
* If a resource already exists in the VFS (i.e. has the same name and
* same id) it is replaced by the imported resource.<p>
*
* If a resource with the same name but a different id exists,
* the imported resource is (usually) moved to the "lost and found" folder.<p>
*
* @param cms the initialized CmsObject
* @param securityManager the initialized OpenCms security manager
* @param resourcename the target name (with full path) for the resource after import
* @param resource the resource to be imported
* @param content the content of the resource
* @param properties the properties of the resource
*
* @return the imported resource
*
* @throws CmsException if something goes wrong
*
* @see CmsSecurityManager#moveToLostAndFound(org.opencms.file.CmsRequestContext, String, boolean)
* @see CmsObject#importResource(String, CmsResource, byte[], List)
* @see CmsSecurityManager#importResource(org.opencms.file.CmsRequestContext, String, CmsResource, byte[], List, boolean)
*/
CmsResource importResource(
CmsObject cms,
CmsSecurityManager securityManager,
String resourcename,
CmsResource resource,
byte[] content,
List properties) throws CmsException;
/**
* Special version of the configuration initialization used with resource types
* to set resource type, id and class name, required for the XML configuration.<p>
*
* <i>Please note:</i> Many resource types defined in the core have in fact
* a fixed resource type and a fixed id. Configurable name and id is used only
* for certain types.<p>
*
* The provided named class must implement this interface (<code>{@link I_CmsResourceType}</code>).
* Usually the provided class name should be the class name of the resource type instance,
* but this may be different in special cases or configuration errors.
*
* For example, if a module is imported that contains it's own resource type class files,
* the included class file are usually not be available until the server is restarted.
* If the named class given in the XML configuration (or module manifest.xml) is not available,
* or not implementing <code>{@link I_CmsResourceType}</code>,
* then <code>{@link CmsResourceTypeUnknown}</code> is used for the resource type instance.<p>
*
* @param name the resource type name
* @param id the resource type id
* @param className the class name of the resource type (read from the XML configuration)
*
* @throws CmsConfigurationException if the configuration is invalid
*/
void initConfiguration(String name, String id, String className) throws CmsConfigurationException;
/**
* Initializes this resource type.<p>
*
* This method will be called once during the OpenCms
* initialization processs. The VFS will already be available
* at the time the method is called.<p>
*
* @param cms a OpenCms context initialized with "Admin" permissions
*/
void initialize(CmsObject cms);
/**
* Indicates that this is an additional resource type which is defined in a module.<p>
* @return true or false
*/
boolean isAdditionalModuleResourceType();
/**
* Returns <code>true</code> if this resource type is direct editable.<p>
*
* @return <code>true</code> if this resource type is direct editable
*/
boolean isDirectEditable();
/**
* Returns <code>true</code> if this resource type is a folder.<p>
*
* @return <code>true</code> if this resource type is a folder
*/
boolean isFolder();
/**
* Locks a resource.<p>
*
* The <code>mode</code> parameter controls what kind of lock is used.<br>
* Possible values for this parameter are: <br>
* <ul>
* <li><code>{@link org.opencms.lock.CmsLock#COMMON}</code></li>
* <li><code>{@link org.opencms.lock.CmsLock#TEMPORARY}</code></li>
* </ul><p>
*
* @param cms the initialized CmsObject
* @param securityManager the initialized OpenCms security manager
* @param resource the resource to lock
* @param mode flag indicating the mode for the lock
*
* @throws CmsException if something goes wrong
*
* @see CmsObject#lockResource(String, int)
* @see CmsSecurityManager#lockResource(org.opencms.file.CmsRequestContext, CmsResource, int)
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -