|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.jcr.business.AbstractRepositoryDAO
fr.paris.lutece.plugins.jcr.business.AbstractRepositoryContentDAO
public abstract class AbstractRepositoryContentDAO
Provides basic methods for node manipulation
Field Summary | |
---|---|
protected static String |
ATTRIBUTE_NODE_SIZE
|
protected static String |
DEFAULT_MIME_TYPE
|
protected static String |
MIXIN_REFERENCEABLE
|
protected static String |
MIXIN_VERSIONNABLE
|
protected static String |
NODE_TYPE_FILE
|
protected static String |
NODE_TYPE_FILE_RESOURCE
|
protected static String |
NODE_TYPE_FOLDER
|
protected static String |
NODE_TYPE_JCR_CONTENT
|
protected static String |
PROPERTY_JCR_DATA
|
protected static String |
PROPERTY_JCR_LASTMODIFIED
|
protected static String |
PROPERTY_JCR_MIMETYPE
|
protected static String |
PROPERTY_JCR_NAME
|
protected static String |
REGEXP_ABSOLUTE_PATH
|
protected static String |
ROOT_NODE_PATH
|
Fields inherited from class fr.paris.lutece.plugins.jcr.business.AbstractRepositoryDAO |
---|
_jcrTemplate, _repositoryInitializer, _strDefaultWorkspaceName |
Constructor Summary | |
---|---|
AbstractRepositoryContentDAO()
|
Method Summary | |
---|---|
void |
create(String strWorkspace,
String strPath)
Create a directory in workspace strWorkspace at absolute path strPath |
void |
create(String strWorkspace,
String strFileName,
File file,
String strMimeType)
Create a file in workspace strWorkspace at absolute path strPath, with file content. |
void |
delete(String strWorkspace,
String strPath)
Remove a file from repository |
protected abstract boolean |
exists(javax.jcr.Node node)
Tells if a node is present in the repository It must be overloaded by children classes |
IRepositoryFile |
findById(String strWorkspace,
String strId)
Find a file by its id |
IRepositoryFile |
findById(String strWorkspace,
String strId,
String strVersion)
Find a file by its id |
IRepositoryFile |
findByPath(String strWorkspace,
String strPath)
Find a file by its path |
protected abstract String |
getAbsolutePath(javax.jcr.Node node)
Returns the entire path (absolute) |
protected abstract Calendar |
getCreated(javax.jcr.Node node)
Gets the creation date of the node It must be overloaded by children classes |
protected int |
getDepth()
|
protected abstract InputStream |
getFileContent(javax.jcr.Node node)
Gives access to node content. |
List<IRepositoryFile> |
getHistory(String strWorkspace,
String strNodeId)
Get all versions for this file |
protected abstract Calendar |
getLastModified(javax.jcr.Node node)
Gets the date of last modification It must be overloaded by children classes |
protected abstract String |
getMimeType(javax.jcr.Node node)
Gives the Mime Type of a node It must be overloaded by children classes |
protected abstract String |
getName(javax.jcr.Node node)
Gives the name of a node It must be overloaded by children classes |
protected String |
getParentUUID(javax.jcr.Node node)
Gives the reference of the parent |
protected abstract String |
getPath(javax.jcr.Node node)
Gives the path of a node It must be overloaded by children classes |
List<IRepositoryFile> |
getPathToFile(String strWorkspace,
String strFilePath)
|
protected abstract Properties |
getProperties()
Gives a way to the configuration properties |
protected String |
getProperty(String strPropertyName)
Retrieves a configuration property |
protected abstract long |
getSize(javax.jcr.Node node)
Gets the size of the content node It must only apply to node of type "file" It must be overloaded by children classes |
protected String |
getUUID(javax.jcr.Node node)
Gives the reference of a node |
protected abstract boolean |
isDirectory(javax.jcr.Node node)
Tells if a node is a directory Note on data structure : a directory doesn't contain anything except other directories and files. |
protected abstract boolean |
isFile(javax.jcr.Node node)
Tells if a node is a file. |
protected boolean |
isVersionnable(javax.jcr.Node node)
Tells whether a node is versionable |
List<IRepositoryFile> |
listFiles(String strWorkspace,
String strPath)
List all files in a directory |
protected boolean |
ownsLock(javax.jcr.Node node)
Tells if the current user owns a lock on node |
String |
removeLock(String strWorkspace,
IRepositoryFile file)
|
protected boolean |
setContent(javax.jcr.Node node,
InputStream inputStream,
String strFileName,
String strMimeType)
Set the content of a node |
String |
setLock(String strWorkspace,
IRepositoryFile file,
String strUsername)
|
void |
setVersionnable(String strWorkspace,
String strNodeId,
boolean isVersionnable)
Set versionable feature for the specified node |
void |
store(String strWorkspace,
IRepositoryFile file)
Submit file changes in repository |
Methods inherited from class fr.paris.lutece.plugins.jcr.business.AbstractRepositoryDAO |
---|
execute, execute, free, init, isAlive, releaseSession |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.paris.lutece.plugins.jcr.business.IJsr170DAO |
---|
free, isAlive |
Field Detail |
---|
protected static final String NODE_TYPE_FOLDER
protected static final String NODE_TYPE_FILE
protected static final String NODE_TYPE_FILE_RESOURCE
protected static final String ATTRIBUTE_NODE_SIZE
protected static final String NODE_TYPE_JCR_CONTENT
protected static final String REGEXP_ABSOLUTE_PATH
protected static final String MIXIN_REFERENCEABLE
protected static final String MIXIN_VERSIONNABLE
protected static final String ROOT_NODE_PATH
protected static final String DEFAULT_MIME_TYPE
protected static final String PROPERTY_JCR_MIMETYPE
protected static final String PROPERTY_JCR_DATA
protected static final String PROPERTY_JCR_LASTMODIFIED
protected static final String PROPERTY_JCR_NAME
Constructor Detail |
---|
public AbstractRepositoryContentDAO()
Method Detail |
---|
public void create(String strWorkspace, String strPath)
IRepositoryFileDAO
create
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrPath
- the absolute pathIRepositoryFileDAO.create(java.lang.String, java.lang.String)
public void create(String strWorkspace, String strFileName, File file, String strMimeType)
IRepositoryFileDAO
create
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrFileName
- the absolute filename to createfile
- the file contentfr.paris.lutece.plugins.jcr.business.IRepositoryFileDAO#create(java.lang.String, java.lang.String, java.io.File)
public void delete(String strWorkspace, String strPath)
IRepositoryFileDAO
delete
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrPath
- the absolute path to deleteIRepositoryFileDAO.delete(java.lang.String, java.lang.String)
public List<IRepositoryFile> listFiles(String strWorkspace, String strPath)
IRepositoryFileDAO
listFiles
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrPath
- the absolute path
IRepositoryFileDAO.listFiles(java.lang.String, java.lang.String)
public IRepositoryFile findById(String strWorkspace, String strId)
IRepositoryFileDAO
findById
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrId
- the id to find
IRepositoryFileDAO.findById(java.lang.String, java.lang.String)
public IRepositoryFile findById(String strWorkspace, String strId, String strVersion)
IRepositoryFileDAO
findById
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrId
- the id to findstrVersion
- the version name to retrieve
IRepositoryFileDAO.findById(java.lang.String, java.lang.String)
protected boolean setContent(javax.jcr.Node node, InputStream inputStream, String strFileName, String strMimeType)
node
- the nodeinputStream
- a stream with the contentstrFileName
- the file name, the mime type is determined with this file name
FileNotFoundException
public IRepositoryFile findByPath(String strWorkspace, String strPath)
IRepositoryFileDAO
findByPath
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrPath
- the absolute path
IRepositoryFileDAO.findByPath(java.lang.String, java.lang.String)
public void store(String strWorkspace, IRepositoryFile file)
IRepositoryFileDAO
store
in interface IRepositoryFileDAO
strWorkspace
- the workspace namefile
- the file containing the modificationspublic void setVersionnable(String strWorkspace, String strNodeId, boolean isVersionnable)
IRepositoryFileDAO
setVersionnable
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrNodeId
- the node idisVersionnable
- true to make the node versionablepublic List<IRepositoryFile> getHistory(String strWorkspace, String strNodeId)
IRepositoryFileDAO
getHistory
in interface IRepositoryFileDAO
strWorkspace
- the workspace namestrNodeId
- the node id
protected boolean isVersionnable(javax.jcr.Node node)
node
- to test
protected String getProperty(String strPropertyName)
strPropertyName
- the property key
protected boolean ownsLock(javax.jcr.Node node)
node
- the node
protected abstract Calendar getCreated(javax.jcr.Node node)
node
- the node
protected abstract long getSize(javax.jcr.Node node)
node
- the node
protected abstract Calendar getLastModified(javax.jcr.Node node)
node
- the node
protected abstract InputStream getFileContent(javax.jcr.Node node)
node
- the node
protected abstract String getMimeType(javax.jcr.Node node)
node
- the node
protected abstract String getPath(javax.jcr.Node node)
node
- the node
protected String getUUID(javax.jcr.Node node)
node
- the node
protected String getParentUUID(javax.jcr.Node node)
node
- the node
protected abstract String getName(javax.jcr.Node node)
node
- the node
protected abstract boolean isFile(javax.jcr.Node node)
node
- the node
protected abstract boolean isDirectory(javax.jcr.Node node)
node
- the node
protected abstract boolean exists(javax.jcr.Node node)
node
- the node
protected abstract String getAbsolutePath(javax.jcr.Node node)
node
- the node
protected abstract Properties getProperties()
public String setLock(String strWorkspace, IRepositoryFile file, String strUsername)
setLock
in interface IRepositoryFileDAO
public String removeLock(String strWorkspace, IRepositoryFile file)
removeLock
in interface IRepositoryFileDAO
protected int getDepth()
public List<IRepositoryFile> getPathToFile(String strWorkspace, String strFilePath)
getPathToFile
in interface IRepositoryFileDAO
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |