public class Resource extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
Resource.Option
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIGURATION_GWT |
static String |
CONFIGURATION_INCLUDE |
static String |
CONFIGURATION_MODULE |
static String |
CONFIGURATION_PAGE |
static String |
CONFIGURATION_WRAPPEDCONTENT |
static String |
CONFIGURATION_WRAPPER |
| Constructor and Description |
|---|
Resource(JCRNodeWrapper node,
String templateType,
String template,
String contextConfiguration)
Creates a resource from the specified parameter
|
Resource(String path,
String canonicalPath,
JCRSessionWrapper sessionWrapper,
String templateType,
String template,
String contextConfiguration)
Lazy resource, that take the path instead of a node, the node will be load at first getNode() call using sessionWrapper
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOption(String wrapper,
ExtendedNodeType nodeType)
Deprecated.
not used anymore
|
boolean |
equals(Object o) |
String |
getContextConfiguration() |
Set<String> |
getDependencies() |
Locale |
getLocale() |
List<String> |
getMissingResources() |
Map<String,Serializable> |
getModuleParams() |
JCRNodeWrapper |
getNode()
Get the node associated to the current resource, in case of a lazy resource the node will be load from jcr if it's null
This function shouldn't not be call before the CacheFilter to avoid loading of node from JCR.
|
String |
getNodePath() |
List<Resource.Option> |
getOptions()
Deprecated.
not used anymore
|
String |
getPath() |
Set<String> |
getRegexpDependencies() |
String |
getResolvedTemplate() |
ExtendedNodeType |
getResourceNodeType() |
Script |
getScript(RenderContext context)
Get the script for the current resource, if the script is null and renderContext is provide as parameter
we try do the resolution of the script, then store it in the current resource, so it's available for the rest
of the render chain.
|
String |
getTemplate() |
String |
getTemplateType() |
String |
getWorkspace() |
int |
hashCode() |
boolean |
hasOptions()
Deprecated.
not used anymore
|
boolean |
hasWrapper() |
boolean |
hasWrapper(String wrapper) |
boolean |
isNodeLoaded()
Know if the JCR Node is available immediately, since the node may require lazy loading from JCR
|
String |
popWrapper() |
String |
pushWrapper(String wrapper) |
void |
removeOption(ExtendedNodeType mixinNodeType)
Deprecated.
not used anymore
|
JCRNodeWrapper |
safeLoadNode()
get the associate Node, but set the flag for lazy load to "It's ok to load the node from JCR if necessary"
To avoid warning message about performance.
|
void |
setContextConfiguration(String contextConfiguration) |
void |
setNode(JCRNodeWrapper node) |
void |
setResourceNodeType(ExtendedNodeType resourceNodeType) |
void |
setTemplate(String template) |
void |
setTemplateType(String templateType) |
String |
toString() |
public static final String CONFIGURATION_PAGE
public static final String CONFIGURATION_GWT
public static final String CONFIGURATION_MODULE
public static final String CONFIGURATION_INCLUDE
public static final String CONFIGURATION_WRAPPER
public static final String CONFIGURATION_WRAPPEDCONTENT
public Resource(JCRNodeWrapper node, String templateType, String template, String contextConfiguration)
node - The node to displaytemplateType - template typetemplate - contextConfiguration - public Resource(String path, String canonicalPath, JCRSessionWrapper sessionWrapper, String templateType, String template, String contextConfiguration)
path - The path to the node to displaycanonicalPath - If the path is a dereference path canonicalPath contains the reference absolute path, empty if notsessionWrapper - The session that will be used to load the nodetemplateType - template typetemplate - contextConfiguration - public JCRNodeWrapper getNode()
public JCRNodeWrapper safeLoadNode()
public boolean isNodeLoaded()
public void setNode(JCRNodeWrapper node)
public String getTemplateType()
public void setTemplateType(String templateType)
public String getWorkspace()
public Locale getLocale()
public void setTemplate(String template)
public String getContextConfiguration()
public String getResolvedTemplate()
public String getTemplate()
public Map<String,Serializable> getModuleParams()
public boolean hasWrapper()
public boolean hasWrapper(String wrapper)
public String popWrapper()
public String getPath()
@Deprecated public void addOption(String wrapper, ExtendedNodeType nodeType)
@Deprecated public List<Resource.Option> getOptions()
@Deprecated public boolean hasOptions()
@Deprecated public void removeOption(ExtendedNodeType mixinNodeType)
public ExtendedNodeType getResourceNodeType()
public void setContextConfiguration(String contextConfiguration)
public Script getScript(RenderContext context) throws javax.jcr.RepositoryException
context - renderContext, needed to resolve the scriptjavax.jcr.RepositoryExceptionpublic String getNodePath()
public void setResourceNodeType(ExtendedNodeType resourceNodeType)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.