mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Page Renderer prototype - various enhancements and refactoring to support modified avm structure, webscript request attributes concept.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6854 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -104,6 +104,13 @@ public class DeclarativeWebScript extends AbstractWebScript
|
||||
model.put("status", status);
|
||||
model.put("cache", cache);
|
||||
|
||||
// extract any request attributes and add them to the model - this is useful for requests
|
||||
// that wish to pass further arbituary data into a webscript model
|
||||
for (String name : req.getAttributeNames())
|
||||
{
|
||||
model.put(name, req.getAttribute(name));
|
||||
}
|
||||
|
||||
// execute script if it exists
|
||||
if (executeScript != null)
|
||||
{
|
||||
@@ -119,7 +126,7 @@ public class DeclarativeWebScript extends AbstractWebScript
|
||||
}
|
||||
|
||||
// create model for template rendering
|
||||
Map<String, Object> templateModel = createTemplateModel(req, res, model);
|
||||
Map<String, Object> templateModel = createTemplateModel(req, res, model);
|
||||
|
||||
// is a redirect to a status specific template required?
|
||||
if (status.getRedirect())
|
||||
|
@@ -118,6 +118,25 @@ public interface WebScriptRequest
|
||||
*/
|
||||
public String[] getParameterValues(String name);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String[] getAttributeNames();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public Object getAttribute(String name);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object[] getAttributeValues();
|
||||
|
||||
/**
|
||||
* Gets the path extension beyond the path registered for this service
|
||||
*
|
||||
|
@@ -186,6 +186,30 @@ public class WebScriptServletRequest extends WebScriptRequestImpl
|
||||
{
|
||||
return req.getParameterValues(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttribute(java.lang.String)
|
||||
*/
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttributeNames()
|
||||
*/
|
||||
public String[] getAttributeNames()
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttributeValues()
|
||||
*/
|
||||
public Object[] getAttributeValues()
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get User Agent
|
||||
|
@@ -84,4 +84,28 @@ public class WebScriptJSFRequest extends WebScriptURLRequest
|
||||
// NOTE: unknown in the JSF environment
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttribute(java.lang.String)
|
||||
*/
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttributeNames()
|
||||
*/
|
||||
public String[] getAttributeNames()
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttributeValues()
|
||||
*/
|
||||
public Object[] getAttributeValues()
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
}
|
||||
|
@@ -116,4 +116,28 @@ public class WebScriptPortletRequest extends WebScriptURLRequest
|
||||
// NOTE: rely on default agent mappings
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttribute(java.lang.String)
|
||||
*/
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttributeNames()
|
||||
*/
|
||||
public String[] getAttributeNames()
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptRequest#getAttributeValues()
|
||||
*/
|
||||
public Object[] getAttributeValues()
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user