|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.file.CmsResourceTypeFolder
Access class for resources of the type "Folder".
| Field Summary |
| Constructor Summary | |
CmsResourceTypeFolder()
|
|
| Method Summary | |
void |
changeLockedInProject(CmsObject cms,
int newProjectId,
String resourcename)
Changes the project-id of the resource to the new project for publishing the resource directly |
void |
chgrp(CmsObject cms,
String filename,
String newGroup,
boolean chRekursive)
Changes the group of a resource. |
void |
chmod(CmsObject cms,
String filename,
int flags,
boolean chRekursive)
Changes the flags of a resource. |
void |
chown(CmsObject cms,
String filename,
String newOwner,
boolean chRekursive)
Changes the owner of a resource. |
void |
chtype(CmsObject cms,
String filename,
String newType)
Changes the resourcetype of a resource. |
void |
copyResource(CmsObject cms,
String source,
String destination,
boolean keepFlags)
Copies a Resource. |
void |
copyResourceToProject(CmsObject cms,
String resourceName)
Copies a resource from the online project to a new, specified project. |
CmsResource |
createResource(CmsObject cms,
String newFolderName,
Map properties,
byte[] contents,
Object parameter)
Creates a new resource. |
void |
deleteResource(CmsObject cms,
String folder)
Deletes a resource. |
CmsFile |
exportResource(CmsObject cms,
CmsFile file)
Does the Linkmanagement when a resource will be exported. |
String |
getLauncherClass()
Returns the name of the Java class loaded by the launcher. |
int |
getLauncherType()
Returns the launcher type needed for this resource-type. |
int |
getResourceType()
Returns the type of this resource-type. |
String |
getResourceTypeName()
Returns the name for this resource-type. |
CmsResource |
importResource(CmsObject cms,
String source,
String destination,
String type,
String user,
String group,
String access,
long lastmodified,
Map properties,
String launcherStartClass,
byte[] content,
String importPath)
Imports a resource. |
void |
init(int resourceType,
int launcherType,
String resourceTypeName,
String launcherClass)
init a new CmsResourceType object. |
void |
lockResource(CmsObject cms,
String resource,
boolean force)
Locks a given resource. |
void |
moveResource(CmsObject cms,
String source,
String destination)
Moves a file to the given destination. |
void |
renameResource(CmsObject cms,
String oldname,
String newname)
Renames the file to the new name. |
void |
restoreResource(CmsObject cms,
int versionId,
String filename)
Restores a file in the current project with a version in the backup |
String |
toString()
Returns a string-representation for this object. |
void |
touch(CmsObject cms,
String resourceName,
long timestamp,
boolean touchRecursive)
Change the timestamp of a folder. |
void |
undeleteResource(CmsObject cms,
String folder)
Undeletes a resource. |
void |
undoChanges(CmsObject cms,
String resource)
Undo changes in a resource. |
void |
unlockResource(CmsObject cms,
String resource)
Unlocks a resource. |
protected void |
validResourcename(String resourcename)
Checks if there are at least one character in the resourcename |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CmsResourceTypeFolder()
| Method Detail |
public void init(int resourceType,
int launcherType,
String resourceTypeName,
String launcherClass)
init in interface I_CmsResourceTyperesourceType - The id of the resource type.launcherType - The id of the required launcher.resourceTypeName - The printable name of the resource type.launcherClass - The Java class that should be invoked by the launcher.
This value is null if the default invokation class should be used.public String getLauncherClass()
getLauncherClass in interface I_CmsResourceTypepublic int getLauncherType()
getLauncherType in interface I_CmsResourceTypepublic String getResourceTypeName()
getResourceTypeName in interface I_CmsResourceTypepublic int getResourceType()
getResourceType in interface I_CmsResourceTypepublic String toString()
toString in class Object
public void chgrp(CmsObject cms,
String filename,
String newGroup,
boolean chRekursive)
throws CmsException
Security: Access is granted, if:
chgrp in interface I_CmsResourceTypefilename - the complete path to the resource.newGroup - the name of the new group for this resource.chRekursive - shows if the subResources (of a folder) should be changed too.
CmsException - if operation was not successful.
public void chmod(CmsObject cms,
String filename,
int flags,
boolean chRekursive)
throws CmsException
Security: Access is granted, if:
chmod in interface I_CmsResourceTypefilename - the complete path to the resource.flags - the new flags for the resource.chRekursive - shows if the subResources (of a folder) should be changed too.
CmsException - if operation was not successful.
for this resource.
public void chown(CmsObject cms,
String filename,
String newOwner,
boolean chRekursive)
throws CmsException
Security: Access is granted, if:
chown in interface I_CmsResourceTypefilename - the complete path to the resource.newOwner - the name of the new owner for this resource.chRekursive - shows if the subResources (of a folder) should be changed too.
CmsException - if operation was not successful.
public void touch(CmsObject cms,
String resourceName,
long timestamp,
boolean touchRecursive)
throws CmsException
touch in interface I_CmsResourceTyperesourceName - the name of the resource to changetimestamp - timestamp the new timestamp of the changed resource
CmsException
public void chtype(CmsObject cms,
String filename,
String newType)
throws CmsException
Security: Access is granted, if:
chtype in interface I_CmsResourceTypefilename - the complete path to the resource.newType - the name of the new resourcetype for this resource.
CmsException - if operation was not successful.
public void copyResource(CmsObject cms,
String source,
String destination,
boolean keepFlags)
throws CmsException
copyResource in interface I_CmsResourceTypesource - the complete path of the sourcefile.destination - the complete path of the destinationfolder.keepFlags - true if the copy should keep the source file's flags,
false if the copy should get the user's default flags.
CmsException - if the file couldn't be copied, or the user
has not the appropriate rights to copy the file.
public void copyResourceToProject(CmsObject cms,
String resourceName)
throws CmsException
copyResourceToProject in interface I_CmsResourceTypecms - The CmsObjectresourceName - The name of the resource
CmsException - if operation was not successful.
public CmsResource createResource(CmsObject cms,
String newFolderName,
Map properties,
byte[] contents,
Object parameter)
throws CmsException
createResource in interface I_CmsResourceTypecontents - the contents of the new file.
CmsFile object representing the newly created file.
CmsException - or if the resourcetype is set to folder. The CmsException is also thrown, if the
filename is not valid or if the user has not the appropriate rights to create a new file.
public void deleteResource(CmsObject cms,
String folder)
throws CmsException
deleteResource in interface I_CmsResourceTypefolder - the complete path of the folder.
CmsException - if the file couldn't be deleted, or if the user
has not the appropriate rights to delete the file.
public void undeleteResource(CmsObject cms,
String folder)
throws CmsException
undeleteResource in interface I_CmsResourceTypefolder - the complete path of the folder.
CmsException - if the file couldn't be undeleted, or if the user
has not the appropriate rights to undelete the file.
public CmsFile exportResource(CmsObject cms,
CmsFile file)
throws CmsException
exportResource in interface I_CmsResourceTypefile - is the file that has to be changed
CmsException
public CmsResource importResource(CmsObject cms,
String source,
String destination,
String type,
String user,
String group,
String access,
long lastmodified,
Map properties,
String launcherStartClass,
byte[] content,
String importPath)
throws CmsException
importResource in interface I_CmsResourceTypecms - The current CmsObject.source - The sourcepath of the resource to import.destination - The destinationpath of the resource to import.type - The type of the resource to import.user - The name of the owner of the resource.group - The name of the group of the resource.access - The access flags of the resource.properties - A Hashtable with the properties of the resource.
The key is the name of the propertydefinition, the value is the propertyvalue.launcherStartClass - The name of the launcher startclass.content - The filecontent if the resource is of type fileimportPath - The name of the import path
Throws - CmsException if the resource could not be imported
CmsException
public void lockResource(CmsObject cms,
String resource,
boolean force)
throws CmsException
lockResource in interface I_CmsResourceTyperesource - the complete path to the resource to lock.force - if force is true, a existing locking will be overwritten.
CmsException - if the user has not the rights to lock this resource.
It will also be thrown, if there is a existing lock and force was set to false.
public void moveResource(CmsObject cms,
String source,
String destination)
throws CmsException
moveResource in interface I_CmsResourceTypesource - the complete path of the sourcefile.destination - the complete path of the destinationfile.
CmsException - if the user has not the rights to move this resource,
or if the file couldn't be moved.
public void renameResource(CmsObject cms,
String oldname,
String newname)
throws CmsException
renameResource in interface I_CmsResourceTypeoldname - the complete path to the file which will be renamed.newname - the new name of the file.
CmsException - if the user has not the rights
to rename the file, or if the file couldn't be renamed.
public void restoreResource(CmsObject cms,
int versionId,
String filename)
throws CmsException
restoreResource in interface I_CmsResourceTypecms - The CmsObjectversionId - The version id of the resourcefilename - The name of the file to restore
CmsException - Throws CmsException if operation was not succesful.
public void undoChanges(CmsObject cms,
String resource)
throws CmsException
undoChanges in interface I_CmsResourceTyperesource - the complete path to the resource to be restored.
CmsException - if the user has not the rights
to write this resource.
public void unlockResource(CmsObject cms,
String resource)
throws CmsException
unlockResource in interface I_CmsResourceTyperesource - the complete path to the resource to be unlocked.
CmsException - if the user has not the rights
to unlock this resource.
protected void validResourcename(String resourcename)
throws CmsException
resourcename - String to check
throws - a exception, if the check fails.
CmsException
public void changeLockedInProject(CmsObject cms,
int newProjectId,
String resourcename)
throws CmsException
changeLockedInProject in interface I_CmsResourceTypenewProjectId - The Id of the new projectresourcename - The name of the resource to change
CmsException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||