org.opencms.gwt
Class CmsVfsService

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by org.opencms.gwt.CmsGwtService
                      extended by org.opencms.gwt.CmsVfsService
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, I_CmsVfsService

public class CmsVfsService
extends CmsGwtService
implements I_CmsVfsService

A service class for reading the VFS tree.

Since:
8.0.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
CmsVfsService()
           
 
Method Summary
protected  java.util.Map<java.lang.String,CmsClientProperty> convertProperties(java.util.List<CmsProperty> properties)
          Converts CmsProperty objects to CmsClientProperty objects.
protected  CmsBrokenLinkBean createSitemapBrokenLinkBean(CmsResource resource)
          Creates a "broken link" bean based on a resource.
 void deleteResource(java.lang.String sitePath)
          Deletes a resource from the VFS.
 void forceUnlock(CmsUUID structureId)
          Forces a resource to be unlocked.
 CmsAvailabilityInfoBean getAvailabilityInfo(CmsUUID structureId)
          Returns a CmsAvailabilityInfoBean for a given resource.
 CmsAvailabilityInfoBean getAvailabilityInfo(java.lang.String vfsPath)
          Returns a CmsAvailabilityInfoBean for a given resource.
 CmsDeleteResourceBean getBrokenLinks(java.lang.String sitePath)
          Returns a list of potentially broken links, if the given resource was deleted.
 java.util.List<CmsVfsEntryBean> getChildren(java.lang.String path)
          Fetches the list of children of a path.
 CmsLockReportInfo getLockReportInfo(CmsUUID structureId)
          Returns the lock report info.
 CmsListInfoBean getPageInfo(CmsUUID structureId)
          Returns a CmsListInfoBean for a given resource.
 CmsListInfoBean getPageInfo(java.lang.String vfsPath)
          Returns a CmsListInfoBean for a given resource.
 java.util.List<CmsVfsEntryBean> getRootEntries()
          Returns the root entries of the VFS.
 java.lang.String getSitePath(CmsUUID structureId)
          Returns the site-path for the resource with the given id.
protected  void internalSaveProperties(CmsPropertyChangeSet changes)
          Saves a set of property changes.
 void internalUpdateProperties(CmsObject cms, CmsResource ownRes, java.util.List<CmsPropertyModification> propertyModifications)
          Updates properties for a resource and possibly its detail page.
 CmsPropertiesBean loadPropertyData(CmsUUID id)
          Load the data necessary to edit the properties of a resource.
protected  CmsVfsEntryBean makeEntryBean(CmsResource resource, boolean root)
          Helper method for creating a VFS entry bean from a resource.
protected  java.util.List<CmsVfsEntryBean> makeEntryBeans(java.util.List<CmsResource> resources, boolean root)
          Helper method for creating a list of VFS entry beans from a list of the corresponding resources.
 void saveProperties(CmsPropertyChangeSet changes)
          Saves a set of property changes.
 
Methods inherited from class org.opencms.gwt.CmsGwtService
checkPermissions, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureSession, error, getCmsObject, getPropertiesByName, getRequest, getResponse, log, log, logError, service, setCms, setContext, setRequest, tryUnlock
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, getSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processPost, shouldCompressResponse
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsVfsService

public CmsVfsService()
Method Detail

deleteResource

public void deleteResource(java.lang.String sitePath)
                    throws CmsRpcException
Description copied from interface: I_CmsVfsService
Deletes a resource from the VFS.

Specified by:
deleteResource in interface I_CmsVfsService
Parameters:
sitePath - the site path of the resource to delete
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsVfsService.deleteResource(java.lang.String)

forceUnlock

public void forceUnlock(CmsUUID structureId)
                 throws CmsRpcException
Description copied from interface: I_CmsVfsService
Forces a resource to be unlocked. In case the given resource is a folder, all sub-resources are also unlocked.

Specified by:
forceUnlock in interface I_CmsVfsService
Parameters:
structureId - the structure id of the resource to unlock
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsVfsService.forceUnlock(org.opencms.util.CmsUUID)

getAvailabilityInfo

public CmsAvailabilityInfoBean getAvailabilityInfo(CmsUUID structureId)
                                            throws CmsRpcException
Description copied from interface: I_CmsVfsService
Returns a CmsAvailabilityInfoBean for a given resource.

Specified by:
getAvailabilityInfo in interface I_CmsVfsService
Parameters:
structureId - the structure id to create the CmsAvailabilityInfoBean for
Returns:
the CmsAvailabilityInfoBean for a given resource
Throws:
CmsRpcException - if the RPC call goes wrong
See Also:
I_CmsVfsService.getAvailabilityInfo(org.opencms.util.CmsUUID)

getAvailabilityInfo

public CmsAvailabilityInfoBean getAvailabilityInfo(java.lang.String vfsPath)
                                            throws CmsRpcException
Description copied from interface: I_CmsVfsService
Returns a CmsAvailabilityInfoBean for a given resource.

Specified by:
getAvailabilityInfo in interface I_CmsVfsService
Parameters:
vfsPath - the vfs path to create the CmsAvailabilityInfoBean for
Returns:
the CmsAvailabilityInfoBean for a given resource
Throws:
CmsRpcException - if the RPC call goes wrong
See Also:
I_CmsVfsService.getAvailabilityInfo(java.lang.String)

getBrokenLinks

public CmsDeleteResourceBean getBrokenLinks(java.lang.String sitePath)
                                     throws CmsRpcException
Description copied from interface: I_CmsVfsService
Returns a list of potentially broken links, if the given resource was deleted.

Specified by:
getBrokenLinks in interface I_CmsVfsService
Parameters:
sitePath - the resource site-path
Returns:
a list of potentially broken links
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsVfsService.getBrokenLinks(java.lang.String)

getChildren

public java.util.List<CmsVfsEntryBean> getChildren(java.lang.String path)
                                            throws CmsRpcException
Description copied from interface: I_CmsVfsService
Fetches the list of children of a path.

Specified by:
getChildren in interface I_CmsVfsService
Parameters:
path - the path for which the list of children should be retrieved
Returns:
the children of the path
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsVfsService.getChildren(java.lang.String)

getLockReportInfo

public CmsLockReportInfo getLockReportInfo(CmsUUID structureId)
                                    throws CmsRpcException
Description copied from interface: I_CmsVfsService
Returns the lock report info.

Specified by:
getLockReportInfo in interface I_CmsVfsService
Parameters:
structureId - the structure id of the resource to get the report for
Returns:
the lock report info
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsVfsService.getLockReportInfo(org.opencms.util.CmsUUID)

getPageInfo

public CmsListInfoBean getPageInfo(CmsUUID structureId)
                            throws CmsRpcException
Description copied from interface: I_CmsVfsService
Returns a CmsListInfoBean for a given resource.

Specified by:
getPageInfo in interface I_CmsVfsService
Parameters:
structureId - the structure id to create the CmsListInfoBean for
Returns:
the CmsListInfoBean for a given resource
Throws:
CmsRpcException - if the RPC call goes wrong
See Also:
I_CmsVfsService.getPageInfo(org.opencms.util.CmsUUID)

getPageInfo

public CmsListInfoBean getPageInfo(java.lang.String vfsPath)
                            throws CmsRpcException
Description copied from interface: I_CmsVfsService
Returns a CmsListInfoBean for a given resource.

Specified by:
getPageInfo in interface I_CmsVfsService
Parameters:
vfsPath - the vfs path to create the CmsListInfoBean for
Returns:
the CmsListInfoBean for a given resource
Throws:
CmsRpcException - if the RPC call goes wrong
See Also:
I_CmsVfsService.getPageInfo(java.lang.String)

getRootEntries

public java.util.List<CmsVfsEntryBean> getRootEntries()
                                               throws CmsRpcException
Description copied from interface: I_CmsVfsService
Returns the root entries of the VFS.

Specified by:
getRootEntries in interface I_CmsVfsService
Returns:
a list of root entries
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsVfsService.getRootEntries()

getSitePath

public java.lang.String getSitePath(CmsUUID structureId)
Description copied from interface: I_CmsVfsService
Returns the site-path for the resource with the given id.

Specified by:
getSitePath in interface I_CmsVfsService
Parameters:
structureId - the structure id
Returns:
the site-path or null if not available
See Also:
I_CmsVfsService.getSitePath(org.opencms.util.CmsUUID)

internalUpdateProperties

public void internalUpdateProperties(CmsObject cms,
                                     CmsResource ownRes,
                                     java.util.List<CmsPropertyModification> propertyModifications)
                              throws CmsException
Updates properties for a resource and possibly its detail page.

Parameters:
cms - the CMS context
ownRes - the resource
propertyModifications - the property modifications
Throws:
CmsException - if something goes wrong

loadPropertyData

public CmsPropertiesBean loadPropertyData(CmsUUID id)
                                   throws CmsRpcException
Description copied from interface: I_CmsVfsService
Load the data necessary to edit the properties of a resource.

Specified by:
loadPropertyData in interface I_CmsVfsService
Parameters:
id - the structure id of a resource
Returns:
the property information for that resource
Throws:
CmsRpcException
See Also:
I_CmsVfsService.loadPropertyData(org.opencms.util.CmsUUID)

saveProperties

public void saveProperties(CmsPropertyChangeSet changes)
                    throws CmsRpcException
Description copied from interface: I_CmsVfsService
Saves a set of property changes.

Specified by:
saveProperties in interface I_CmsVfsService
Parameters:
changes - a set of property changes
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsVfsService.saveProperties(org.opencms.gwt.shared.property.CmsPropertyChangeSet)

convertProperties

protected java.util.Map<java.lang.String,CmsClientProperty> convertProperties(java.util.List<CmsProperty> properties)
Converts CmsProperty objects to CmsClientProperty objects.

Parameters:
properties - a list of server-side properties
Returns:
a map of client-side properties

createSitemapBrokenLinkBean

protected CmsBrokenLinkBean createSitemapBrokenLinkBean(CmsResource resource)
                                                 throws CmsException
Creates a "broken link" bean based on a resource.

Parameters:
resource - the resource
Returns:
the "broken link" bean with the data from the resource
Throws:
CmsException - if something goes wrong

internalSaveProperties

protected void internalSaveProperties(CmsPropertyChangeSet changes)
                               throws CmsException
Saves a set of property changes.

Parameters:
changes - the set of property changes
Throws:
CmsException - if something goes wrong

makeEntryBean

protected CmsVfsEntryBean makeEntryBean(CmsResource resource,
                                        boolean root)
                                 throws CmsException
Helper method for creating a VFS entry bean from a resource.

Parameters:
resource - the resource whose data should be stored in the bean
root - true if the resource is a root resource
Returns:
the data bean representing the resource
Throws:
CmsException - if something goes wrong

makeEntryBeans

protected java.util.List<CmsVfsEntryBean> makeEntryBeans(java.util.List<CmsResource> resources,
                                                         boolean root)
                                                  throws CmsException
Helper method for creating a list of VFS entry beans from a list of the corresponding resources.

Parameters:
resources - the list of resources which should be converted to entry beans
root - true if the resources in the list are root resources
Returns:
the list of VFS entry beans for the resources
Throws:
CmsException - if something goes wrong