Merge of all UI clustering changes originally applied to 2.2

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2008-02-15 14:59:11 +00:00
parent d20d8a7007
commit a450598ecb
281 changed files with 17771 additions and 15322 deletions

View File

@@ -26,8 +26,6 @@ package org.alfresco.web.bean.wcm;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -43,9 +41,9 @@ import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
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.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.spaces.EditSpaceDialog;
@@ -58,8 +56,10 @@ import org.alfresco.web.ui.common.component.UIListItem;
*/
public class EditFolderPropertiesDialog extends EditSpaceDialog
{
private static final long serialVersionUID = -6423913727249054187L;
protected AVMBrowseBean avmBrowseBean;
protected AVMService avmService;
transient private AVMService avmService;
// ------------------------------------------------------------------------------
@@ -81,6 +81,15 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog
this.avmService = avmService;
}
protected AVMService getAvmService()
{
if (avmService == null)
{
avmService = (AVMService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "AVMLockingAwareService");
}
return avmService;
}
// ------------------------------------------------------------------------------
// Dialog implementation
@@ -109,12 +118,12 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog
}
// get the current set of properties from the repository
Map<QName, Serializable> repoProps = this.nodeService.getProperties(nodeRef);
Map<QName, Serializable> repoProps = this.getNodeService().getProperties(nodeRef);
// add the "uifacets" aspect if required, properties will get set below
if (this.nodeService.hasAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS) == false)
if (this.getNodeService().hasAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS) == false)
{
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null);
this.getNodeService().addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null);
}
// overwrite the current properties with the edited ones
@@ -131,7 +140,7 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog
if ((propValue != null) && (propValue instanceof String) &&
(propValue.toString().length() == 0))
{
PropertyDefinition propDef = this.dictionaryService.getProperty(qname);
PropertyDefinition propDef = this.getDictionaryService().getProperty(qname);
if (propDef != null)
{
if (propDef.getDataType().getName().equals(DataTypeDefinition.DOUBLE) ||
@@ -160,12 +169,12 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog
}
// send the properties back to the repository
this.avmService.setNodeProperties(AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond(), avmProps);
this.getAvmService().setNodeProperties(AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond(), avmProps);
// perform the rename last as for an AVM it changes the NodeRef
if (name != null)
{
this.fileFolderService.rename(nodeRef, name);
this.getFileFolderService().rename(nodeRef, name);
editedProps.put(ContentModel.PROP_NAME.toString(), name);
}
@@ -180,7 +189,7 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog
String name = this.editableNode.getName();
String oldPath = AVMNodeConverter.ToAVMVersionPath(this.editableNode.getNodeRef()).getSecond();
String newPath = oldPath.substring(0, oldPath.lastIndexOf('/') + 1) + name;
this.avmBrowseBean.setAvmActionNode(new AVMNode(this.avmService.lookup(-1, newPath)));
this.avmBrowseBean.setAvmActionNode(new AVMNode(this.getAvmService().lookup(-1, newPath)));
return outcome;
}
@@ -188,12 +197,12 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog
public List<UIListItem> getIcons()
{
List<UIListItem> icons = new ArrayList<UIListItem>(1);
UIListItem item = new UIListItem();
item.setValue(DEFAULT_SPACE_ICON_NAME);
item.setImage("/images/icons/" + DEFAULT_SPACE_ICON_NAME + ".gif");
icons.add(item);
return icons;
}
}