Checkpoint of code/config for the action config definition and externalisation task

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2544 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-03-13 18:07:35 +00:00
parent 5659614fff
commit 45135f13eb
10 changed files with 637 additions and 26 deletions

View File

@@ -27,16 +27,12 @@ import javax.faces.event.ActionEvent;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.UIMenu;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @author kevinr
*/
public class ActionLinkRenderer extends BaseRenderer
{
private static Log logger = LogFactory.getLog(ActionLinkRenderer.class);
// ------------------------------------------------------------------------------
// Renderer implementation
@@ -55,8 +51,7 @@ public class ActionLinkRenderer extends BaseRenderer
// on the request which match our params and set them into the component
UIActionLink link = (UIActionLink)component;
Map<String, String> destParams = link.getParameterMap();
destParams.clear();
Map<String, String> actionParams = getParameterMap(link);
Map<String, String> actionParams = getParameterComponents(link);
if (actionParams != null)
{
for (String name : actionParams.keySet())
@@ -122,7 +117,7 @@ public class ActionLinkRenderer extends BaseRenderer
{
// generate JavaScript to set a hidden form field and submit
// a form which request attributes that we can decode
linkBuf.append(Utils.generateFormSubmit(context, link, Utils.getActionHiddenFieldName(context, link), link.getClientId(context), getParameterMap(link)));
linkBuf.append(Utils.generateFormSubmit(context, link, Utils.getActionHiddenFieldName(context, link), link.getClientId(context), getParameterComponents(link)));
}
linkBuf.append('"');
@@ -270,7 +265,7 @@ public class ActionLinkRenderer extends BaseRenderer
if (link.getHref() == null)
{
buf.append("<a href='#' onclick=\"");
buf.append(Utils.generateFormSubmit(context, link, Utils.getActionHiddenFieldName(context, link), link.getClientId(context), getParameterMap(link)));
buf.append(Utils.generateFormSubmit(context, link, Utils.getActionHiddenFieldName(context, link), link.getClientId(context), getParameterComponents(link)));
buf.append('"');
}
else

View File

@@ -83,13 +83,13 @@ public abstract class BaseRenderer extends Renderer
*
* @return a Map of name/value pairs or null if none found
*/
protected static Map<String, String> getParameterMap(UIComponent component)
protected static Map<String, String> getParameterComponents(UIComponent component)
{
Map<String, String> params = null;
if (component.getChildCount() != 0)
{
params = new HashMap<String, String>(3, 1.0f);
params = new HashMap<String, String>(component.getChildCount(), 1.0f);
for (Iterator i=component.getChildren().iterator(); i.hasNext(); /**/)
{
UIComponent child = (UIComponent)i.next();