. Perf improvements to submit dialog lists
. Minor CSS fix

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5063 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-02-07 11:55:49 +00:00
parent a0b1fc5ae3
commit cda0d4761f
2 changed files with 114 additions and 94 deletions

View File

@@ -29,6 +29,7 @@ import java.util.regex.Pattern;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
import org.alfresco.config.JNDIConstants;
import org.alfresco.model.ContentModel;
@@ -56,6 +57,7 @@ import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.BrowseBean;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.config.ClientConfigElement;
import org.alfresco.web.forms.FormInstanceData;
import org.alfresco.web.forms.FormInstanceDataImpl;
@@ -465,14 +467,17 @@ public class SubmitDialog extends BaseDialogBean
for (ItemWrapper wrapper : this.submitItems)
{
String path = wrapper.getPath();
for (int i=0; i<workflowMatchers.size(); i++)
// shallow copy the list of matchers so we can remove items while looping
List<FormWorkflowWrapper> matchers = new ArrayList<FormWorkflowWrapper>(workflowMatchers);
for (int i=0; i<matchers.size(); i++)
{
FormWorkflowWrapper matcher = matchers.get(i);
// see if the file path matches this workflow path pattern
if (workflowMatchers.get(i).matchesPath(path) == true)
if (matcher.matchesPath(path) == true)
{
// found a match - remove the workflow from the list of ones to check
this.workflows.add(workflowMatchers.get(i));
workflowMatchers.remove(i);
this.workflows.add(matcher);
workflowMatchers.remove(matcher);
}
}
// if all workflows are matched, there is no need to continue looping
@@ -557,7 +562,14 @@ public class SubmitDialog extends BaseDialogBean
*/
private void calcluateListItemsAndWorkflows()
{
// TODO: start txn here?
UserTransaction tx = null;
try
{
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context, true);
tx.begin();
List<AVMNodeDescriptor> selected;
if (this.avmBrowseBean.getAllItemsAction())
{
@@ -674,6 +686,14 @@ public class SubmitDialog extends BaseDialogBean
this.submitItems = Collections.<ItemWrapper>emptyList();
this.warningItems = Collections.<ItemWrapper>emptyList();
}
tx.commit();
}
catch (Throwable e)
{
// rollback the transaction on error
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
}
}
/**

View File

@@ -417,7 +417,7 @@ a.topToolbarLinkHighlight, a.topToolbarLinkHighlight:link, a.topToolbarLinkHighl
.selectedItemsHeader
{
padding: 4px;
background-color: #c6d8eb;
background-color: #ECECEC;
font-weight: bold;
text-align: left;
}