org.hippoecm.hst.pagecomposer.jaxrs.services
Class MountResource

java.lang.Object
  extended by org.hippoecm.hst.pagecomposer.jaxrs.services.AbstractConfigResource
      extended by org.hippoecm.hst.pagecomposer.jaxrs.services.MountResource

public class MountResource
extends AbstractConfigResource

Version:
$Id$

Field Summary
 
Fields inherited from class org.hippoecm.hst.pagecomposer.jaxrs.services.AbstractConfigResource
BEANS_ANNOTATED_CLASSES_CONF_PARAM
 
Constructor Summary
MountResource()
           
 
Method Summary
 javax.ws.rs.core.Response createDocument(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, javax.ws.rs.core.MultivaluedMap<String,String> params)
          Creates a document in the repository using the WorkFlowManager The post parameters should contain the 'path', 'docType' and 'name' of the document.
 javax.ws.rs.core.Response discardChanges(javax.servlet.http.HttpServletRequest servletRequest)
          If the Mount that this request belongs to has a preview configuration, it will be discarded.
 javax.ws.rs.core.Response getDocumentsByType(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, String docType)
          Method that returns a Response containing the list of document of (sub)type docType that belong to the content of the site that is currently composed.
 javax.ws.rs.core.Response getPageModelRepresentation(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, String pageId)
           
 javax.ws.rs.core.Response getToolkitRepresentation(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
           
 javax.ws.rs.core.Response publish(javax.servlet.http.HttpServletRequest servletRequest)
          If the Mount that this request belongs to does not have a preview configuration, it will be created.
 javax.ws.rs.core.Response setLock(javax.servlet.http.HttpServletRequest servletRequest)
          Try to lock a mount.
 javax.ws.rs.core.Response startEdit(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          If the Mount that this request belongs to does not have a preview configuration, it will be created.
 javax.ws.rs.core.Response unlock(javax.servlet.http.HttpServletRequest servletRequest)
          If the Mount that this request belongs to has a preview configuration, it will be unlocked and deleted.
 
Methods inherited from class org.hippoecm.hst.pagecomposer.jaxrs.services.AbstractConfigResource
error, error, getAnnotatedClasses, getCurrentMountCanonicalContentPath, getEditingHstMount, getEditingHstSite, getObjectConverter, getRequestConfigIdentifier, getRequestConfigNode, getRequestContext, ok, ok, setCurrentMountCanonicalContentPath, setMountDecorator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MountResource

public MountResource()
Method Detail

getPageModelRepresentation

public javax.ws.rs.core.Response getPageModelRepresentation(@Context
                                                            javax.servlet.http.HttpServletRequest servletRequest,
                                                            @Context
                                                            javax.servlet.http.HttpServletResponse servletResponse,
                                                            String pageId)

getToolkitRepresentation

public javax.ws.rs.core.Response getToolkitRepresentation(@Context
                                                          javax.servlet.http.HttpServletRequest servletRequest,
                                                          @Context
                                                          javax.servlet.http.HttpServletResponse servletResponse)

setLock

public javax.ws.rs.core.Response setLock(@Context
                                         javax.servlet.http.HttpServletRequest servletRequest)
Try to lock a mount.

Parameters:
servletRequest -
Returns:
ok - already-locked Response when the mount was already locked. ok - lock-acquired Response when the lock was acquired error Response when something went wrong

startEdit

public javax.ws.rs.core.Response startEdit(@Context
                                           javax.servlet.http.HttpServletRequest servletRequest,
                                           @Context
                                           javax.servlet.http.HttpServletResponse servletResponse)
If the Mount that this request belongs to does not have a preview configuration, it will be created. If it already has a preview configuration, just an ok Response is returned.

Parameters:
servletRequest -
servletResponse -
Returns:
ok Response when editing can start, and error Response otherwise

discardChanges

public javax.ws.rs.core.Response discardChanges(@Context
                                                javax.servlet.http.HttpServletRequest servletRequest)
If the Mount that this request belongs to has a preview configuration, it will be discarded.

Parameters:
servletRequest -
Returns:
ok Response when the discard completed, error Response otherwise

unlock

public javax.ws.rs.core.Response unlock(@Context
                                        javax.servlet.http.HttpServletRequest servletRequest)
If the Mount that this request belongs to has a preview configuration, it will be unlocked and deleted.

Parameters:
servletRequest -
Returns:
ok Response when the discard completed, error Response otherwise

publish

public javax.ws.rs.core.Response publish(@Context
                                         javax.servlet.http.HttpServletRequest servletRequest)
If the Mount that this request belongs to does not have a preview configuration, it will be created. If it already has a preview configuration, just an ok Response is returned.

Parameters:
servletRequest -
Returns:
ok Response when editing can start, and error Response otherwise

createDocument

public javax.ws.rs.core.Response createDocument(@Context
                                                javax.servlet.http.HttpServletRequest servletRequest,
                                                @Context
                                                javax.servlet.http.HttpServletResponse servletResponse,
                                                javax.ws.rs.core.MultivaluedMap<String,String> params)
Creates a document in the repository using the WorkFlowManager The post parameters should contain the 'path', 'docType' and 'name' of the document.

Parameters:
servletRequest - Servlet Request
servletResponse - Servlet Response
params - The POST parameters
Returns:
response JSON with the status of the result

getDocumentsByType

public javax.ws.rs.core.Response getDocumentsByType(@Context
                                                    javax.servlet.http.HttpServletRequest servletRequest,
                                                    @Context
                                                    javax.servlet.http.HttpServletResponse servletResponse,
                                                    String docType)
Method that returns a Response containing the list of document of (sub)type docType that belong to the content of the site that is currently composed.

Parameters:
servletRequest -
servletResponse -
docType - the docType the found documents must be of. The documents can also be a subType of docType
Returns:
An ok Response containing the list of documents or an error response in case an exception occurred


Copyright © 2008-2012 Hippo. All Rights Reserved.