Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webengine.model.impl
Class AbstractResource<T extends ResourceType>

java.lang.Object
  extended by org.nuxeo.ecm.webengine.model.impl.AbstractResource<T>
All Implemented Interfaces:
Resource, Adaptable
Direct Known Subclasses:
DefaultAdapter, DefaultObject

public abstract class AbstractResource<T extends ResourceType>
extends Object
implements Resource

Author:
Bogdan Stefanescu

Constructor Summary
AbstractResource()
           
 
Method Summary
 boolean checkGuard(String guard)
          Checks the given guard expression in the context of this resource.
 void dispose()
           
 AdapterResource getActiveAdapter()
          Returns the active Adapter on this object if any in the current request.
<A> A
getAdapter(Class<A> adapter)
          Returns an object which is an instance of the given class associated with this object.
 WebContext getContext()
           
 Set<String> getFacets()
           
 List<LinkDescriptor> getLinks(String category)
           
 Module getModule()
           
 String getName()
           
 Resource getNext()
           
 String getNextSegment()
           
 String getPath()
           
 Resource getPrevious()
           
 Template getTemplate(String fileName)
           
 String getTrailingPath()
           
 T getType()
           
 String getURL()
           
 Template getView(String viewId)
           
 boolean hasFacet(String facet)
           
 Resource initialize(WebContext ctx, ResourceType type, Object... args)
           
 boolean isAdapter()
           
 boolean isInstanceOf(String type)
           
 boolean isRoot()
           
 AdapterResource newAdapter(String type, Object... args)
           
 Resource newObject(String type, Object... args)
           
 Response redirect(String uri)
           
 void setNext(Resource next)
           
 void setPrevious(Resource previous)
           
 void setRoot(boolean isRoot)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractResource

public AbstractResource()
Method Detail

initialize

public Resource initialize(WebContext ctx,
                           ResourceType type,
                           Object... args)
Specified by:
initialize in interface Resource

isAdapter

public boolean isAdapter()
Specified by:
isAdapter in interface Resource

isRoot

public boolean isRoot()
Specified by:
isRoot in interface Resource

setRoot

public void setRoot(boolean isRoot)
Specified by:
setRoot in interface Resource

isInstanceOf

public boolean isInstanceOf(String type)
Specified by:
isInstanceOf in interface Resource

redirect

public Response redirect(String uri)
Specified by:
redirect in interface Resource

getActiveAdapter

public AdapterResource getActiveAdapter()
Description copied from interface: Resource
Returns the active Adapter on this object if any in the current request.

Specified by:
getActiveAdapter in interface Resource
Returns:
the service instance or null

dispose

public void dispose()
Specified by:
dispose in interface Resource

getFacets

public Set<String> getFacets()
Specified by:
getFacets in interface Resource

hasFacet

public boolean hasFacet(String facet)
Specified by:
hasFacet in interface Resource

getType

public T getType()
Specified by:
getType in interface Resource

getContext

public WebContext getContext()
Specified by:
getContext in interface Resource

getModule

public Module getModule()
Specified by:
getModule in interface Resource

getNext

public Resource getNext()
Specified by:
getNext in interface Resource

setNext

public void setNext(Resource next)
Specified by:
setNext in interface Resource

getPrevious

public Resource getPrevious()
Specified by:
getPrevious in interface Resource

setPrevious

public void setPrevious(Resource previous)
Specified by:
setPrevious in interface Resource

getName

public String getName()
Specified by:
getName in interface Resource

getPath

public String getPath()
Specified by:
getPath in interface Resource

getTrailingPath

public String getTrailingPath()
Specified by:
getTrailingPath in interface Resource

getNextSegment

public String getNextSegment()
Specified by:
getNextSegment in interface Resource

getURL

public String getURL()
Specified by:
getURL in interface Resource

getLinks

public List<LinkDescriptor> getLinks(String category)
Specified by:
getLinks in interface Resource

getAdapter

public <A> A getAdapter(Class<A> adapter)
Description copied from interface: Adaptable
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

Specified by:
getAdapter in interface Adaptable
Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class

newObject

public Resource newObject(String type,
                          Object... args)
Specified by:
newObject in interface Resource

newAdapter

public AdapterResource newAdapter(String type,
                                  Object... args)
Specified by:
newAdapter in interface Resource

getView

public Template getView(String viewId)
Specified by:
getView in interface Resource

getTemplate

public Template getTemplate(String fileName)
Specified by:
getTemplate in interface Resource

checkGuard

public boolean checkGuard(String guard)
                   throws ParseException
Description copied from interface: Resource
Checks the given guard expression in the context of this resource.

Specified by:
checkGuard in interface Resource
Throws:
ParseException

toString

public String toString()
Overrides:
toString in class Object

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.