Merge from HEAD into WCM-DEV2. Also fixes build breakage in

jndi-client and catalina-virtual that I introduced earlier. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3393 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-24 18:27:41 +00:00
parent ca9496d090
commit f6355ea108
171 changed files with 11880 additions and 3450 deletions

View File

@@ -88,6 +88,8 @@ public final class Utils
private static final String DEFAULT_FILE_IMAGE16 = IMAGE_PREFIX16 + "_default" + IMAGE_POSTFIX;
private static final String DEFAULT_FILE_IMAGE32 = IMAGE_PREFIX32 + "_default" + IMAGE_POSTFIX;
private static final String AJAX_SCRIPTS_WRITTEN = "_alfAjaxScriptsWritten";
private static final Map<String, String> s_fileExtensionMap = new HashMap<String, String>(89, 1.0f);
private static Log logger = LogFactory.getLog(Utils.class);
@@ -1238,4 +1240,37 @@ public final class Utils
return description;
}
/**
* Writes the script tags for including AJAX support, ensuring they
* only get written once per page render.
*
* @param context Faces context
* @param out The response writer
*/
@SuppressWarnings("unchecked")
public static void writeAjaxScripts(FacesContext context, ResponseWriter out)
throws IOException
{
Object present = context.getExternalContext().getRequestMap().get(AJAX_SCRIPTS_WRITTEN);
if (present == null)
{
// write out the scripts
out.write("\n<script type=\"text/javascript\" src=\"");
out.write(context.getExternalContext().getRequestContextPath());
out.write("/scripts/ajax/dojo.js\"> </script>\n");
out.write("<script type=\"text/javascript\" src=\"");
out.write(context.getExternalContext().getRequestContextPath());
out.write("/scripts/ajax/common.js\"> </script>\n");
// write out a global variable to hold the webapp context path
out.write("<script type=\"text/javascript\">var WEBAPP_CONTEXT = '");
out.write(context.getExternalContext().getRequestContextPath());
out.write("';</script>\n");
// add marker to request
context.getExternalContext().getRequestMap().put(AJAX_SCRIPTS_WRITTEN, Boolean.TRUE);
}
}
}

View File

@@ -19,9 +19,6 @@ package org.alfresco.web.ui.common.component;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Component to represent a selectable list of images
*
@@ -29,8 +26,6 @@ import org.apache.commons.logging.LogFactory;
*/
public class UIImagePicker extends UIInput
{
private static Log logger = LogFactory.getLog(UIImagePicker.class);
/**
* Default constructor
*/

View File

@@ -65,7 +65,7 @@ public class UISortLink extends UICommand
boolean bPreviouslySorted = false;
boolean descending = true;
String lastSortedColumn = dataContainer.getCurrentSortColumn();
if (lastSortedColumn == (String)getValue())
if (lastSortedColumn != null && lastSortedColumn.equals(getValue()))
{
descending = !dataContainer.isCurrentSortDescending();
bPreviouslySorted = true;

View File

@@ -28,8 +28,6 @@ import javax.faces.el.ValueBinding;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.SelfRenderingComponent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Dynamic description component that switches text based on the events
@@ -39,7 +37,6 @@ import org.apache.commons.logging.LogFactory;
*/
public class UIDynamicDescription extends SelfRenderingComponent
{
private static Log logger = LogFactory.getLog(UIDynamicDescription.class);
private String selected;
private String functionName;
@@ -141,6 +138,7 @@ public class UIDynamicDescription extends SelfRenderingComponent
/**
* @see javax.faces.component.UIComponent#encodeChildren(javax.faces.context.FacesContext)
*/
@SuppressWarnings("unchecked")
public void encodeChildren(FacesContext context) throws IOException
{
if (this.isRendered() == false)
@@ -240,6 +238,7 @@ public class UIDynamicDescription extends SelfRenderingComponent
* @param context The faces context
* @param descriptions The descriptions to render
*/
@SuppressWarnings("unchecked")
private void renderDescriptions(FacesContext context, UIDescriptions descriptions)
throws IOException
{

View File

@@ -129,7 +129,7 @@ public abstract class BaseEvaluator extends SelfRenderingComponent
public abstract boolean evaluate();
protected static Logger s_logger = Logger.getLogger(BaseEvaluator.class);
protected static final Logger s_logger = Logger.getLogger(BaseEvaluator.class);
/** the value to be evaluated against */
private Object value;

View File

@@ -57,7 +57,7 @@ public class ActionLinkTag extends HtmlComponentTag
setStringProperty(component, "value", this.value);
setStringProperty(component, "target", this.target);
setStringProperty(component, "onclick", this.onclick);
setBooleanProperty(component, "immediate", this.immediate);
// TODO: Add image width/height properties
}
@@ -77,6 +77,7 @@ public class ActionLinkTag extends HtmlComponentTag
this.href = null;
this.target = null;
this.onclick = null;
this.immediate = null;
}
/**
@@ -178,6 +179,11 @@ public class ActionLinkTag extends HtmlComponentTag
{
this.onclick = onclick;
}
public void setImmediate(String immediate)
{
this.immediate = immediate;
}
/** the target */
private String target;
@@ -208,4 +214,7 @@ public class ActionLinkTag extends HtmlComponentTag
/** the onclick handler */
private String onclick;
/** the immediate flag */
private String immediate;
}