Merged V2.1 to HEAD:

6556: AVM performance tweaks
   6557: WCM-758.
   6558: Fixes WCM-753.
   6559: better handling of rename, copy and paste for form instance data and renditions.  addresses WCM-752 and partially addresses WCM-559.
   6560: Renamed JndiTest.java until we decide to keep it or not.
   6561: Oops.
   6562: probable fix WCM-669      
   6563: Build fix after the removal of flushing suport 
   6564: Fix for WCM-728
   6566: Support for avm index clustering via tracking - WCM-762
   6567: Test fix after flush changes
   6568: Fixed AWC-1517: Can now create space based on existing top-level space
   6569: misc IE fixes.
   6570: Various changes to improve AVM import performance and submit performance.
   6571: Session flushing is now deprecated and doesn't fail with an exception.
   6572: Reduced the iteration count to stress nextResults calls a bit more
   6573: WS query sessions put back into cache after more results have been fetched.
   6574: AR-1347: RepositoryServiceSoapBindingStub.queryAssociated() returns nothing when direction=target
   6575: Fixed AR-1680: XPath metadata extraction now handles Node, NodeList and String return values
   6577: Fix for AWC-1518 (User Homes renaming issue, and unreported issue with client config overriding of users home location)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6745 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-11 02:37:29 +00:00
parent 1b9a268ae3
commit 61808ef4a7
18 changed files with 196 additions and 25 deletions

View File

@@ -653,7 +653,6 @@ public abstract class UserMembersBean implements IContextListener
// and add each of the new permissions in turn
NodeRef nodeRef = getNode().getNodeRef();
this.permissionService.clearPermission(nodeRef, getPersonAuthority());
AlfrescoTransactionSupport.flush();
for (PermissionWrapper wrapper : personRoles)
{
this.permissionService.setPermission(

View File

@@ -47,6 +47,8 @@ import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.avm.*;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
@@ -126,7 +128,8 @@ public class AVMWorkflowUtil extends WorkflowUtil
// convert package to workflow package
final AVMNodeDescriptor packageDesc = avmService.lookup(-1, packagesPath);
final NodeRef packageNodeRef = workflowService.createPackage(AVMNodeConverter.ToNodeRef(-1, packageDesc.getPath()));
avmService.setNodeProperty(packagesPath, WorkflowModel.PROP_IS_SYSTEM_PACKAGE, new PropertyValue(null, true));
avmService.setNodeProperty(packagesPath, WorkflowModel.PROP_IS_SYSTEM_PACKAGE, new PropertyValue(DataTypeDefinition.BOOLEAN, true));
// apply global permission to workflow package
// TODO: Determine appropriate permissions

View File

@@ -33,6 +33,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.web.bean.dialog.BaseDialogBean;
@@ -132,7 +133,7 @@ public class CreateFolderDialog extends BaseDialogBean
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null);
if (this.description != null && this.description.length() != 0)
{
this.avmService.setNodeProperty(path, ContentModel.PROP_DESCRIPTION, new PropertyValue(null, this.description));
this.avmService.setNodeProperty(path, ContentModel.PROP_DESCRIPTION, new PropertyValue(DataTypeDefinition.TEXT, this.description));
// this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, this.description);
}

View File

@@ -49,7 +49,8 @@ public class CreateWebappDialog extends CreateFolderDialog
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
final String parent = AVMUtil.buildSandboxRootPath(this.avmBrowseBean.getStagingStore());
final String stagingStore = this.avmBrowseBean.getStagingStore();
final String parent = AVMUtil.buildSandboxRootPath( stagingStore );
this.avmService.createDirectory(parent, this.name);
final String path = AVMNodeConverter.ExtendAVMPath(parent, this.name);
@@ -62,6 +63,9 @@ public class CreateWebappDialog extends CreateFolderDialog
new PropertyValue(DataTypeDefinition.TEXT,
this.description));
}
// Snapshot the store with the empty webapp
this.avmService.createSnapshot( stagingStore, null, null);
return outcome;
}

View File

@@ -223,6 +223,9 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.avmLockingService.addWebProject(avmStore);
outcome = AlfrescoNavigationHandler.CLOSE_WIZARD_OUTCOME;
// Snapshot the store with the empty webapp
this.avmService.createSnapshot( avmStore, null, null);
}
return outcome;
}

View File

@@ -28,11 +28,13 @@ import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMService;
@@ -48,6 +50,8 @@ import org.alfresco.web.app.Application;
import org.alfresco.web.bean.content.EditContentPropertiesDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.forms.*;
import org.alfresco.web.ui.common.Utils;
/**
* Backing bean for the Edit File Properties dialog.
@@ -58,6 +62,7 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog
{
protected AVMBrowseBean avmBrowseBean;
protected AVMService avmService;
protected FormsService formsService;
// ------------------------------------------------------------------------------
@@ -78,6 +83,14 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog
{
this.avmService = avmService;
}
/**
* @param formsService The FormsService to set.
*/
public void setFormsService(final FormsService formsService)
{
this.formsService = formsService;
}
// ------------------------------------------------------------------------------
@@ -176,8 +189,47 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog
// perform the rename last as for an AVM it changes the NodeRef
if (name != null)
{
this.fileFolderService.rename(nodeRef, name);
if (this.nodeService.hasAspect(nodeRef, WCMAppModel.ASPECT_RENDITION))
{
throw new UnsupportedOperationException(this.nodeService.getProperty(nodeRef, ContentModel.PROP_NAME) +
" is a " + WCMAppModel.ASPECT_RENDITION +
" and cannot be renamed");
}
// need to find out if it's a form instance data before rename. for whatever reason,
// afterwards it claims it is not
if (this.nodeService.hasAspect(nodeRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
{
final FormInstanceData fid = this.formsService.getFormInstanceData(nodeRef);
// delete all existing renditions
for (final Rendition r : fid.getRenditions())
{
this.avmService.removeNode(r.getPath());
}
this.nodeService.removeProperty(nodeRef, WCMAppModel.PROP_RENDITIONS);
}
String path = AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond();
final String parentPath = AVMNodeConverter.SplitBase(path)[0];
final String oldName = AVMNodeConverter.SplitBase(path)[1];
this.avmService.rename(parentPath, oldName, parentPath, name);
nodeRef = AVMNodeConverter.ToNodeRef(-1, AVMNodeConverter.ExtendAVMPath(parentPath, name));
editedProps.put(ContentModel.PROP_NAME.toString(), name);
if (this.nodeService.hasAspect(nodeRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
{
final FormInstanceData fid = this.formsService.getFormInstanceData(nodeRef);
for (final FormInstanceData.RegenerateResult rr : fid.regenerateRenditions())
{
if (rr.getException() != null)
{
outcome = null;
Utils.addErrorMessage("error regenerating rendition using " + rr.getRenderingEngineTemplate().getName() +
": " + rr.getException().getMessage(),
rr.getException());
}
}
}
}
return outcome;

View File

@@ -426,7 +426,8 @@ public class NewUserWizard extends AbstractWizardBean
String oldHomeSpaceName = Repository.getNameForNode(nodeService, oldHomeFolderRef);
if (oldHomeSpaceName.equals(this.homeSpaceName) == false &&
oldHomeFolderRef.equals(this.homeSpaceLocation) == false)
oldHomeFolderRef.equals(this.homeSpaceLocation) == false &&
oldHomeFolderRef.equals(this.defaultHomeSpaceRef) == false)
{
renameHomeSpace = true;
}

View File

@@ -67,7 +67,7 @@ public class ClientConfigElement extends ConfigElementAdapter
private String initialLocation = "myalfresco";
private ExpiringValueCache<String> wcmDomain = new ExpiringValueCache<String>(1000*10L);
private ExpiringValueCache<String> wcmPort = new ExpiringValueCache<String>(1000*10L);
private String defaultHomeSpacePath = "/app:company_home";
private String defaultHomeSpacePath = "/app:company_home/app:user_homes";
private boolean clipboardStatusVisible = true;
private boolean pasteAllAndClear = true;
private boolean allowGuestConfig = false;
@@ -148,6 +148,12 @@ public class ClientConfigElement extends ConfigElementAdapter
}
// override default values if they have changed
if (newElement.getDefaultHomeSpacePath() != null &&
newElement.getDefaultHomeSpacePath().equals(combinedElement.getDefaultHomeSpacePath()) == false)
{
combinedElement.setDefaultHomeSpacePath(newElement.getDefaultHomeSpacePath());
}
if (newElement.getRecentSpacesItems() != combinedElement.getRecentSpacesItems())
{
combinedElement.setRecentSpacesItems(newElement.getRecentSpacesItems());

View File

@@ -207,19 +207,34 @@ import org.xml.sax.SAXException;
final List<Rendition> result = new ArrayList<Rendition>(renditionPaths.size());
for (Serializable path : renditionPaths)
{
if (avmService.lookup(-1, storeName + ':' + (String)path) != null)
if (avmService.lookup(-1, storeName + ':' + (String)path) == null)
{
final Rendition r = new RenditionImpl(AVMNodeConverter.ToNodeRef(-1, storeName + ':' + (String)path),
LOGGER.debug("ignoring dangling rendition at " + storeName + ':' + (String)path);
}
else
{
final Rendition r = new RenditionImpl(-1,
storeName + ':' + (String)path,
this.formsService);
try
{
if (!this.equals(r.getPrimaryFormInstanceData()))
{
LOGGER.debug("rendition " + r +
" points at form instance data " + r.getPrimaryFormInstanceData() +
" instead of " + this + ". Not including in renditions list.");
continue;
}
}
catch (FileNotFoundException fnfe)
{
continue;
}
if (r.getRenderingEngineTemplate() != null)
{
result.add(r);
}
}
else
{
LOGGER.debug("ignoring dangling rendition at " + storeName + ':' + (String)path);
}
}
return result;
}
@@ -250,6 +265,13 @@ import org.xml.sax.SAXException;
}
}
public boolean equals(final Object other)
{
return (other instanceof FormInstanceDataImpl &&
this.getNodeRef().equals(((FormInstanceDataImpl)other).getNodeRef()));
}
protected String getParentFormName()
{
final NodeService nodeService = this.getServiceRegistry().getNodeService();

View File

@@ -234,7 +234,13 @@ import org.xml.sax.SAXException;
public int hashCode()
{
return this.getPath().hashCode() ^ this.getRenderingEngineTemplate().hashCode();
return this.getPath().hashCode();
}
public boolean equals(final Object other)
{
return (other instanceof RenditionImpl &&
this.getNodeRef().equals(((RenditionImpl)other).getNodeRef()));
}
public String toString()

View File

@@ -134,11 +134,15 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
// NOTE: Whenever latestVersion > baseVersion, link validation is "behind".
if (latestVersion > baseVersion)
{
out.write("&nbsp;(<img src='");
pattern = bundle.getString("link_check_not_latest");
String latestVersionInfo =
MessageFormat.format(
pattern, new Object[] { new Integer( latestVersion )});
out.write("&nbsp;<img src='");
out.write(context.getExternalContext().getRequestContextPath());
out.write("/images/icons/warning.gif' />&nbsp;");
out.write(bundle.getString("link_check_not_latest"));
out.write(")");
out.write( latestVersionInfo );
}
pattern = bundle.getString("link_check_items_found");