public class ResourceServiceImpl extends Object implements ResourceService
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
ResourceServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
checkout(Resource resource,
DavSession session)
Versioning-part.
|
protected void |
checkPublished(User user,
Document doc) |
protected void |
checkPublished(User user,
long docId) |
void |
copyResource(Resource destinationResource,
Resource resource,
DavSession session)
Copying of a resource within logicalDOC.
|
Resource |
createResource(Resource parentResource,
String name,
boolean isCollection,
ImportContext context,
DavSession session)
Handle of resource creation by passed parent resource as well as the most
import parameters needed for a resource creation.
|
void |
deleteResource(Resource resource,
DavSession session)
Deletion of a resource within logicalDOC.
|
protected void |
finalize() |
Resource |
getChildByName(Resource parentResource,
String name)
Based on the parent resource it will be tried to get a child by a
specific name
|
List<Resource> |
getChildResources(Resource parentResource)
On passing a valid
|
List<Resource> |
getHistory(Resource resource)
Versioning-part.
|
Resource |
getParentResource(Resource resource)
Based on the current resource location it will be turned back the upper
resource
|
Resource |
getParentResource(String resourcePath,
long userId,
DavSession session)
Based on a location path (given by
|
Resource |
getResource(String requestPath,
DavSession session)
On passing a location as well as the current session you gettin back the
appropriated resource.
|
boolean |
isCheckedOut(Resource resource) |
Resource |
move(Resource source,
Resource destination,
DavSession session)
Moves a resource named target to the folder dictionary destination
|
boolean |
resourceExists(Resource resource)
Check for existing resource(logically)
|
void |
setDocumentDAO(DocumentDAO documentDAO) |
void |
setDocumentManager(DocumentManager documentManager) |
void |
setFolderDAO(FolderDAO folderDAO) |
void |
setStorer(Storer storer) |
void |
setUserDAO(UserDAO userDAO) |
void |
setVersionDAO(VersionDAO versionDAO) |
void |
streamIn(Resource resource,
InputStream is) |
InputStream |
streamOut(Resource resource) |
void |
uncheckout(Resource resource,
DavSession session) |
Resource |
updateResource(Resource resource)
Updating a resource on passing all new properties though a valid resource
object.
|
void |
updateResource(Resource resource,
ImportContext context,
DavSession session)
Updating a resource on passing all new properties though a valid resource
object.
|
public void setUserDAO(UserDAO userDAO)
public void setDocumentDAO(DocumentDAO documentDAO)
public void setDocumentManager(DocumentManager documentManager)
public List<Resource> getChildResources(Resource parentResource)
ResourceService
getChildResources
in interface ResourceService
parentResource
- The resource(mostly a folder) from which are all
direct childs has to be fetched and turned backpublic Resource getResource(String requestPath, DavSession session) throws org.apache.jackrabbit.webdav.DavException
ResourceService
getResource
in interface ResourceService
requestPath
- The location retrieved through DavResourceLocator.getResourcePath()
session
- The current sessionorg.apache.jackrabbit.webdav.DavException
public Resource getParentResource(String resourcePath, long userId, DavSession session)
ResourceService
getParentResource
in interface ResourceService
resourcePath
- the resource pathuserId
- the user idsession
- the current sessioncom.logicaldoc.webdav.resource.service.ResourceService#getParentResource(java.lang.String,
long)
protected void finalize() throws Throwable
public Resource createResource(Resource parentResource, String name, boolean isCollection, ImportContext context, DavSession session) throws org.apache.jackrabbit.webdav.DavException
ResourceService
createResource
in interface ResourceService
parentResource
- The parent resource(mostly a folder)name
- the filename and titlename of the childisCollection
- is the resource folder?context
- for inputstreamsession
- the current sessionResource
org.apache.jackrabbit.webdav.DavException
public void updateResource(Resource resource, ImportContext context, DavSession session) throws org.apache.jackrabbit.webdav.DavException
ResourceService
updateResource
in interface ResourceService
resource
- The updateable resourcecontext
- the ImportContextsession
- the current sessionorg.apache.jackrabbit.webdav.DavException
public Resource getChildByName(Resource parentResource, String name)
ResourceService
getChildByName
in interface ResourceService
parentResource
- The parent resourcename
- name of the child must bepublic boolean resourceExists(Resource resource)
ResourceService
resourceExists
in interface ResourceService
resource
- The Resourcepublic Resource updateResource(Resource resource)
ResourceService
updateResource
in interface ResourceService
resource
- The updateable resourcepublic Resource move(Resource source, Resource destination, DavSession session) throws org.apache.jackrabbit.webdav.DavException
ResourceService
move
in interface ResourceService
source
- the resource that is involveddestination
- the destination of the move operationsession
- the current sessionorg.apache.jackrabbit.webdav.DavException
public void deleteResource(Resource resource, DavSession session) throws org.apache.jackrabbit.webdav.DavException
ResourceService
deleteResource
in interface ResourceService
resource
- a vaild resourcesession
- the current sessionorg.apache.jackrabbit.webdav.DavException
public void copyResource(Resource destinationResource, Resource resource, DavSession session) throws org.apache.jackrabbit.webdav.DavException
ResourceService
copyResource
in interface ResourceService
session
- the current sessionorg.apache.jackrabbit.webdav.DavException
public Resource getParentResource(Resource resource)
ResourceService
getParentResource
in interface ResourceService
resource
- the current resourcepublic void streamIn(Resource resource, InputStream is)
streamIn
in interface ResourceService
public InputStream streamOut(Resource resource)
streamOut
in interface ResourceService
public void checkout(Resource resource, DavSession session) throws org.apache.jackrabbit.webdav.DavException
ResourceService
checkout
in interface ResourceService
resource
- The appropriated resource that has to be checked outsession
- the current sessionorg.apache.jackrabbit.webdav.DavException
public boolean isCheckedOut(Resource resource)
protected void checkPublished(User user, Document doc) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
protected void checkPublished(User user, long docId) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
public List<Resource> getHistory(Resource resource)
ResourceService
getHistory
in interface ResourceService
resource
- The appropriated resourcepublic void uncheckout(Resource resource, DavSession session)
uncheckout
in interface ResourceService
session
- the current sessionpublic void setVersionDAO(VersionDAO versionDAO)
public void setFolderDAO(FolderDAO folderDAO)
public void setStorer(Storer storer)
Copyright © 2008-2014 Logical Objects. All Rights Reserved.