mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge V1.3 to HEAD (3045:3063)
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3045 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3063 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3340 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -768,7 +768,7 @@ public class AdminNodeBrowseBean
|
||||
/**
|
||||
* Permission representing the fact that "Read Permissions" has not been granted
|
||||
*/
|
||||
public class NoReadPermissionGranted
|
||||
public static class NoReadPermissionGranted
|
||||
{
|
||||
public String getPermission()
|
||||
{
|
||||
|
@@ -1531,7 +1531,11 @@ public class AdvancedSearchBean
|
||||
AspectDefinition aspectDef = dd.getAspect(aspect);
|
||||
propDef = aspectDef.getProperties().get(propQName);
|
||||
}
|
||||
customPropertyLookup.put(propQName.toString(), propDef.getDataType());
|
||||
|
||||
if (propQName != null && propDef != null)
|
||||
{
|
||||
customPropertyLookup.put(propQName.toString(), propDef.getDataType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -58,6 +58,14 @@ public class CheckinCheckoutBean
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
|
||||
/**
|
||||
* @param navigator The NavigationBean to set.
|
||||
*/
|
||||
public void setNavigator(NavigationBean navigator)
|
||||
{
|
||||
this.navigator = navigator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the BrowseBean.
|
||||
*/
|
||||
@@ -535,6 +543,7 @@ public class CheckinCheckoutBean
|
||||
String id = params.get("id");
|
||||
if (id != null && id.length() != 0)
|
||||
{
|
||||
boolean editingInline = false;
|
||||
Node node = setupContentDocument(id);
|
||||
|
||||
// detect the inline editing aspect to see which edit mode to use
|
||||
@@ -544,50 +553,44 @@ public class CheckinCheckoutBean
|
||||
{
|
||||
// retrieve the content reader for this node
|
||||
ContentReader reader = getContentService().getReader(node.getNodeRef(), ContentModel.PROP_CONTENT);
|
||||
String mimetype = reader.getMimetype();
|
||||
|
||||
// calculate which editor screen to display
|
||||
if (MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_XML.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_TEXT_CSS.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype))
|
||||
if (reader != null)
|
||||
{
|
||||
// make content available to the editing screen
|
||||
if (reader != null)
|
||||
editingInline = true;
|
||||
String mimetype = reader.getMimetype();
|
||||
|
||||
// calculate which editor screen to display
|
||||
if (MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_XML.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_TEXT_CSS.equals(mimetype) ||
|
||||
MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype))
|
||||
{
|
||||
// make content available to the editing screen
|
||||
setEditorOutput(reader.getContentString());
|
||||
|
||||
// navigate to appropriate screen
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
this.navigator.setupDispatchContext(node);
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "editTextInline");
|
||||
}
|
||||
else
|
||||
{
|
||||
setEditorOutput("");
|
||||
}
|
||||
|
||||
// navigate to appropriate screen
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "editTextInline");
|
||||
}
|
||||
else
|
||||
{
|
||||
// make content available to the editing screen
|
||||
if (reader != null)
|
||||
{
|
||||
// make content available to the editing screen
|
||||
setDocumentContent(reader.getContentString());
|
||||
setEditorOutput(null);
|
||||
|
||||
// navigate to appropriate screen
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
this.navigator.setupDispatchContext(node);
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "editHtmlInline");
|
||||
}
|
||||
else
|
||||
{
|
||||
setDocumentContent("");
|
||||
}
|
||||
setEditorOutput(null);
|
||||
|
||||
// navigate to appropriate screen
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "editHtmlInline");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (editingInline == false)
|
||||
{
|
||||
// normal downloadable document
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
this.navigator.setupDispatchContext(node);
|
||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "editFile");
|
||||
}
|
||||
}
|
||||
@@ -750,7 +753,6 @@ public class CheckinCheckoutBean
|
||||
// we can either checkin the content from the current working copy node
|
||||
// which would have been previously updated by the user
|
||||
String contentUrl;
|
||||
String mimetype;
|
||||
if (getCopyLocation().equals(COPYLOCATION_CURRENT))
|
||||
{
|
||||
ContentData contentData = (ContentData) node.getProperties().get(ContentModel.PROP_CONTENT);
|
||||
@@ -785,11 +787,9 @@ public class CheckinCheckoutBean
|
||||
props.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
|
||||
}
|
||||
|
||||
NodeRef originalDoc = this.versionOperationsService.checkin(
|
||||
node.getNodeRef(),
|
||||
props,
|
||||
contentUrl,
|
||||
this.keepCheckedOut);
|
||||
// perform the checkin
|
||||
this.versionOperationsService.checkin(node.getNodeRef(),
|
||||
props, contentUrl, this.keepCheckedOut);
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
@@ -941,6 +941,9 @@ public class CheckinCheckoutBean
|
||||
/** The BrowseBean to be used by the bean */
|
||||
protected BrowseBean browseBean;
|
||||
|
||||
/** The NavigationBean bean reference */
|
||||
protected NavigationBean navigator;
|
||||
|
||||
/** The NodeService to be used by the bean */
|
||||
protected NodeService nodeService;
|
||||
|
||||
|
@@ -103,7 +103,7 @@ public class ExportBean
|
||||
params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName);
|
||||
params.put(ExporterActionExecuter.PARAM_ENCODING, this.encoding);
|
||||
params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination);
|
||||
params.put(ExporterActionExecuter.PARAM_INCLUDE_CHILDREN, new Boolean(includeChildren));
|
||||
params.put(ExporterActionExecuter.PARAM_INCLUDE_CHILDREN, Boolean.valueOf(includeChildren));
|
||||
params.put(ExporterActionExecuter.PARAM_INCLUDE_SELF, new Boolean(includeSelf));
|
||||
action = this.actionService.createAction(ExporterActionExecuter.NAME, params);
|
||||
}
|
||||
|
@@ -137,7 +137,7 @@ public class LinkPropertiesBean
|
||||
Map<String, Object> props = this.editableNode.getProperties();
|
||||
|
||||
// get the name and move the node as necessary
|
||||
String name = (String)props.get(ContentModel.PROP_NAME);
|
||||
//String name = (String)props.get(ContentModel.PROP_NAME);
|
||||
//if (name != null)
|
||||
//{
|
||||
// fileFolderService.rename(nodeRef, name);
|
||||
|
@@ -36,6 +36,7 @@ import org.alfresco.repo.node.archive.RestoreNodeReport.RestoreStatus;
|
||||
import org.alfresco.repo.search.impl.lucene.QueryParser;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -537,6 +538,20 @@ public class TrashcanBean implements IContextListener
|
||||
}
|
||||
};
|
||||
|
||||
private NodePropertyResolver resolverMimetype = new NodePropertyResolver() {
|
||||
public Object get(Node node) {
|
||||
ContentData content = (ContentData)node.getProperties().get(ContentModel.PROP_CONTENT);
|
||||
return (content != null ? content.getMimetype() : null);
|
||||
}
|
||||
};
|
||||
|
||||
private NodePropertyResolver resolverSize = new NodePropertyResolver() {
|
||||
public Object get(Node node) {
|
||||
ContentData content = (ContentData)node.getProperties().get(ContentModel.PROP_CONTENT);
|
||||
return (content != null ? new Long(content.getSize()) : 0L);
|
||||
}
|
||||
};
|
||||
|
||||
private NodePropertyResolver resolverDeletedDate = new NodePropertyResolver() {
|
||||
public Object get(Node node) {
|
||||
return node.getProperties().get(ContentModel.PROP_ARCHIVED_DATE);
|
||||
@@ -613,6 +628,8 @@ public class TrashcanBean implements IContextListener
|
||||
node.addPropertyResolver("deletedDate", resolverDeletedDate);
|
||||
node.addPropertyResolver("deletedBy", resolverDeletedBy);
|
||||
node.addPropertyResolver("isFolder", resolverIsFolder);
|
||||
node.addPropertyResolver("mimetype", resolverMimetype);
|
||||
node.addPropertyResolver("size", resolverSize);
|
||||
|
||||
if (this.dictionaryService.isSubClass(node.getType(), ContentModel.TYPE_FOLDER) == true &&
|
||||
this.dictionaryService.isSubClass(node.getType(), ContentModel.TYPE_SYSTEM_FOLDER) == false)
|
||||
|
@@ -124,7 +124,7 @@ public class WorkflowUtil
|
||||
// first we need to take off the simpleworkflow aspect
|
||||
nodeService.removeAspect(ref, ContentModel.ASPECT_SIMPLE_WORKFLOW);
|
||||
|
||||
if (rejectMove.booleanValue())
|
||||
if (rejectMove != null && rejectMove.booleanValue())
|
||||
{
|
||||
// move the document to the specified folder
|
||||
String qname = QName.createValidLocalName(docNode.getName());
|
||||
|
@@ -230,24 +230,31 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
||||
{
|
||||
QName idQName = Repository.resolveToQName(child.getAttribute("name"));
|
||||
|
||||
// try and get the display label from config
|
||||
String label = Utils.getDisplayLabel(context, child);
|
||||
|
||||
// if there wasn't a client based label try and get it from the dictionary
|
||||
if (label == null)
|
||||
if (idQName != null)
|
||||
{
|
||||
AspectDefinition aspectDef = this.dictionaryService.getAspect(idQName);
|
||||
if (aspectDef != null)
|
||||
// try and get the display label from config
|
||||
String label = Utils.getDisplayLabel(context, child);
|
||||
|
||||
// if there wasn't a client based label try and get it from the dictionary
|
||||
if (label == null)
|
||||
{
|
||||
label = aspectDef.getTitle();
|
||||
}
|
||||
else
|
||||
{
|
||||
label = idQName.getLocalName();
|
||||
AspectDefinition aspectDef = this.dictionaryService.getAspect(idQName);
|
||||
if (aspectDef != null)
|
||||
{
|
||||
label = aspectDef.getTitle();
|
||||
}
|
||||
else
|
||||
{
|
||||
label = idQName.getLocalName();
|
||||
}
|
||||
}
|
||||
|
||||
this.aspects.add(new SelectItem(idQName.toString(), label));
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn("Failed to resolve aspect '" + child.getAttribute("name") + "'");
|
||||
}
|
||||
|
||||
this.aspects.add(new SelectItem(idQName.toString(), label));
|
||||
}
|
||||
|
||||
// make sure the list is sorted by the label
|
||||
@@ -875,6 +882,11 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
||||
}
|
||||
}
|
||||
|
||||
public int hashCode()
|
||||
{
|
||||
return authority.hashCode();
|
||||
}
|
||||
|
||||
private String name;
|
||||
private String authority;
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ import java.util.ResourceBundle;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import org.alfresco.repo.action.executer.CheckInActionExecuter;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -26,9 +27,19 @@ import org.alfresco.web.data.QuickSort;
|
||||
*/
|
||||
public class RunActionWizard extends BaseActionWizard
|
||||
{
|
||||
protected boolean checkinActionPresent = false;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
this.checkinActionPresent = false;
|
||||
}
|
||||
|
||||
protected String finishImpl(FacesContext context, String outcome)
|
||||
throws Exception
|
||||
{
|
||||
@@ -40,6 +51,12 @@ public class RunActionWizard extends BaseActionWizard
|
||||
String actionName = (String)actionParams.get(PROP_ACTION_NAME);
|
||||
this.action = actionName;
|
||||
|
||||
// remember the fact we have a checkin action
|
||||
if (actionName.equals(CheckInActionExecuter.NAME))
|
||||
{
|
||||
this.checkinActionPresent = true;
|
||||
}
|
||||
|
||||
// get the action handler to prepare for the save
|
||||
Map<String, Serializable> repoActionParams = new HashMap<String, Serializable>();
|
||||
IHandler handler = this.actionHandlers.get(this.action);
|
||||
@@ -104,6 +121,14 @@ public class RunActionWizard extends BaseActionWizard
|
||||
space.reset();
|
||||
}
|
||||
|
||||
// special case handling for checkin - if it was successful the working
|
||||
// copy node the Run Action Wizard was launched against will no longer
|
||||
// exist, we therefore need the client to go back to the main browse view.
|
||||
if (this.checkinActionPresent)
|
||||
{
|
||||
outcome = "browse";
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ public class CheckInHandler extends BaseActionHandler
|
||||
@Override
|
||||
public void setupUIDefaults(Map<String, Serializable> actionProps)
|
||||
{
|
||||
actionProps.put(PROP_CHECKIN_MINOR, new Boolean(true));
|
||||
actionProps.put(PROP_CHECKIN_MINOR, Boolean.TRUE);
|
||||
}
|
||||
|
||||
public String getJSPPath()
|
||||
|
@@ -311,6 +311,13 @@ public class ClipboardBean
|
||||
dd.isSubClass(item.Node.getType(), ContentModel.TYPE_FOLDER))
|
||||
{
|
||||
// copy the file/folder
|
||||
// first check that we are not attempting to copy a duplicate into the same parent
|
||||
if (destRef.equals(assocRef.getParentRef()) && name.equals(item.Node.getName()))
|
||||
{
|
||||
// manually change the name if this occurs
|
||||
String copyOf = Application.getMessage(FacesContext.getCurrentInstance(), MSG_COPY_OF);
|
||||
name = copyOf + ' ' + name;
|
||||
}
|
||||
this.fileFolderService.copy(
|
||||
item.Node.getNodeRef(),
|
||||
destRef,
|
||||
|
@@ -24,10 +24,7 @@ import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Lighweight client side representation of the repository data dictionary.
|
||||
@@ -38,9 +35,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
*/
|
||||
public final class DataDictionary
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(DataDictionary.class);
|
||||
private DictionaryService dictionaryService;
|
||||
private NamespaceService namespaceService;
|
||||
private Map<QName, TypeDefinition> types = new HashMap<QName, TypeDefinition>(11, 1.0f);
|
||||
|
||||
/**
|
||||
|
@@ -48,7 +48,7 @@ public class Node implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 3544390322739034169L;
|
||||
|
||||
protected static Log logger = LogFactory.getLog(Node.class);
|
||||
protected static final Log logger = LogFactory.getLog(Node.class);
|
||||
|
||||
protected NodeRef nodeRef;
|
||||
private String name;
|
||||
|
@@ -327,7 +327,7 @@ public class RulesBean implements IContextListener
|
||||
* Inner class to wrap the Rule objects so we can expose a flag to indicate whether
|
||||
* the rule is a local or inherited rule
|
||||
*/
|
||||
public class WrappedRule
|
||||
public static class WrappedRule
|
||||
{
|
||||
private Rule rule;
|
||||
private NodeRef ruleNode;
|
||||
|
@@ -289,14 +289,9 @@ public class UsersBean implements IContextListener
|
||||
*/
|
||||
public String deleteOK()
|
||||
{
|
||||
UserTransaction tx = null;
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
try
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
tx = Repository.getUserTransaction(context);
|
||||
tx.begin();
|
||||
|
||||
String userName = (String)getPerson().getProperties().get("userName");
|
||||
|
||||
// we only delete the user auth if Alfresco is managing the authentication
|
||||
@@ -310,25 +305,21 @@ public class UsersBean implements IContextListener
|
||||
}
|
||||
catch (AuthenticationException authErr)
|
||||
{
|
||||
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(), ERROR_USER_DELETE));
|
||||
Utils.addErrorMessage(Application.getMessage(context, ERROR_USER_DELETE));
|
||||
}
|
||||
}
|
||||
|
||||
// delete the associated Person
|
||||
this.personService.deletePerson(userName);
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
|
||||
// re-do the search to refresh the list
|
||||
search();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
// rollback the transaction
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext
|
||||
.getCurrentInstance(), ERROR_DELETE), e.getMessage()), e);
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context,
|
||||
ERROR_DELETE), e.getMessage()), e);
|
||||
}
|
||||
|
||||
return DIALOG_CLOSE;
|
||||
|
@@ -94,6 +94,7 @@ public abstract class Sort
|
||||
*
|
||||
* @param collator the Collator object to use to build String keys
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected List buildCollationKeys(Collator collator)
|
||||
{
|
||||
List data = this.data;
|
||||
@@ -260,6 +261,7 @@ public abstract class Sort
|
||||
* Given the array and two indices, swap the two items in the
|
||||
* array.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void swap(final List v, final int a, final int b)
|
||||
{
|
||||
Object temp = v.get(a);
|
||||
@@ -294,7 +296,7 @@ public abstract class Sort
|
||||
// ------------------------------------------------------------------------------
|
||||
// Inner classes for data type comparison
|
||||
|
||||
private class SimpleComparator implements Comparator
|
||||
private static class SimpleComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
@@ -308,7 +310,7 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private class SimpleStringComparator implements Comparator
|
||||
private static class SimpleStringComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
@@ -322,7 +324,7 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private class StringComparator implements Comparator
|
||||
private static class StringComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
@@ -336,7 +338,7 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private class IntegerComparator implements Comparator
|
||||
private static class IntegerComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
@@ -350,7 +352,7 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private class FloatComparator implements Comparator
|
||||
private static class FloatComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
@@ -364,7 +366,7 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private class LongComparator implements Comparator
|
||||
private static class LongComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
@@ -378,7 +380,7 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private class BooleanComparator implements Comparator
|
||||
private static class BooleanComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
@@ -392,7 +394,7 @@ public abstract class Sort
|
||||
}
|
||||
}
|
||||
|
||||
private class DateComparator implements Comparator
|
||||
private static class DateComparator implements Comparator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.data.IDataComparator#compare(java.lang.Object, java.lang.Object)
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -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.equals(getValue()))
|
||||
{
|
||||
descending = !dataContainer.isCurrentSortDescending();
|
||||
bPreviouslySorted = true;
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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;
|
||||
|
@@ -739,37 +739,40 @@ public class UIPropertySheet extends UIPanel implements NamingContainer
|
||||
}
|
||||
|
||||
// now setup the common stuff across all component types
|
||||
FacesHelper.setupComponentId(context, propSheetItem, id);
|
||||
propSheetItem.setName(item.getName());
|
||||
propSheetItem.setConverter(item.getConverter());
|
||||
propSheetItem.setComponentGenerator(item.getComponentGenerator());
|
||||
propSheetItem.setIgnoreIfMissing(item.getIgnoreIfMissing());
|
||||
|
||||
String displayLabel = item.getDisplayLabel();
|
||||
if (item.getDisplayLabelId() != null)
|
||||
if (propSheetItem != null)
|
||||
{
|
||||
String label = Application.getMessage(context, item.getDisplayLabelId());
|
||||
if (label != null)
|
||||
FacesHelper.setupComponentId(context, propSheetItem, id);
|
||||
propSheetItem.setName(item.getName());
|
||||
propSheetItem.setConverter(item.getConverter());
|
||||
propSheetItem.setComponentGenerator(item.getComponentGenerator());
|
||||
propSheetItem.setIgnoreIfMissing(item.getIgnoreIfMissing());
|
||||
|
||||
String displayLabel = item.getDisplayLabel();
|
||||
if (item.getDisplayLabelId() != null)
|
||||
{
|
||||
displayLabel = label;
|
||||
String label = Application.getMessage(context, item.getDisplayLabelId());
|
||||
if (label != null)
|
||||
{
|
||||
displayLabel = label;
|
||||
}
|
||||
}
|
||||
propSheetItem.setDisplayLabel(displayLabel);
|
||||
|
||||
// if this property sheet is set as read only or the config says the property
|
||||
// should be read only set it as such
|
||||
if (isReadOnly() || item.isReadOnly())
|
||||
{
|
||||
propSheetItem.setReadOnly(true);
|
||||
}
|
||||
|
||||
this.getChildren().add(propSheetItem);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Created property sheet item component " + propSheetItem + "(" +
|
||||
propSheetItem.getClientId(context) +
|
||||
") for '" + item.getName() +
|
||||
"' and added it to property sheet " + this);
|
||||
}
|
||||
propSheetItem.setDisplayLabel(displayLabel);
|
||||
|
||||
// if this property sheet is set as read only or the config says the property
|
||||
// should be read only set it as such
|
||||
if (isReadOnly() || item.isReadOnly())
|
||||
{
|
||||
propSheetItem.setReadOnly(true);
|
||||
}
|
||||
|
||||
this.getChildren().add(propSheetItem);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Created property sheet item component " + propSheetItem + "(" +
|
||||
propSheetItem.getClientId(context) +
|
||||
") for '" + item.getName() +
|
||||
"' and added it to property sheet " + this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -103,7 +103,7 @@ public class DefaultModelHelper
|
||||
}
|
||||
|
||||
/** Template Image resolver helper */
|
||||
public static TemplateImageResolver imageResolver = new TemplateImageResolver()
|
||||
public static final TemplateImageResolver imageResolver = new TemplateImageResolver()
|
||||
{
|
||||
public String resolveImagePathForName(String filename, boolean small)
|
||||
{
|
||||
|
@@ -67,7 +67,6 @@ public class NodeDescendantsLinkRenderer extends BaseRenderer
|
||||
int separatorIndex = value.indexOf(NamingContainer.SEPARATOR_CHAR);
|
||||
String selectedNodeId = value.substring(0, separatorIndex);
|
||||
boolean isParent = Boolean.parseBoolean(value.substring(separatorIndex + 1));
|
||||
NodeService service = getNodeService(context);
|
||||
NodeRef ref = new NodeRef(Repository.getStoreRef(), selectedNodeId);
|
||||
|
||||
UINodeDescendants.NodeSelectedEvent event = new UINodeDescendants.NodeSelectedEvent(component, ref, isParent);
|
||||
|
@@ -883,6 +883,10 @@
|
||||
<property-name>browseBean</property-name>
|
||||
<value>#{BrowseBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>navigator</property-name>
|
||||
<value>#{NavigationBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
|
@@ -20,4 +20,8 @@
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
||||
|
||||
<h:outputText value="#{WizardManager.bean.summary}" escape="false"/>
|
||||
<h:outputText value="#{WizardManager.bean.summary}" escape="false"/>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onload = function() { document.getElementById("wizard:finish-button").focus(); }
|
||||
</script>
|
Reference in New Issue
Block a user