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:
Kevin Roast
2007-09-21 13:48:56 +00:00
parent ef2c905758
commit 3df0a89e60
6 changed files with 232 additions and 76 deletions

View File

@@ -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())

View File

@@ -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
*

View File

@@ -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

View File

@@ -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];
}
}

View File

@@ -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];
}
}