mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD (V2.1 sourced fixes)
7121: Merged V2.1 to V2.2 7049: Fix for unreported duplicate component ID error (very rarely seen) in browse WCM sandbox JSP 7058: Fixes failure to rollback correctly on failed alfresco->alfresco deployment. 7074: Added filtering/access control checks to the AVM virtualization view. 7083: Added transaction handling to calls involving preview store 7084: xmlsec library update to 1.4.1 7092: Missing config update from the AVM filtering checkin. 7124: Merged V2.1 to V2.2 7091: Fix to several issues found with Regenerate Renditions wizard and FormsService 7125: Merged V2.1 to V2.2 7093: Fixes to workaround some deployment issues being experienced by a customer. 7094: Fix for previous build failure git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7373 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -204,9 +204,31 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
String storeName = AVMUtil.getStoreName(this.avmBrowseBean.getCurrentPath());
|
||||
storeName = AVMUtil.getCorrespondingPreviewStoreName(storeName);
|
||||
final String path = AVMUtil.buildStoreRootPath(storeName);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("reseting layer " + path);
|
||||
this.avmSyncService.resetLayer(path);
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
|
||||
RetryingTransactionCallback<String> callback = new RetryingTransactionCallback<String>()
|
||||
{
|
||||
public String execute() throws Throwable
|
||||
{
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("reseting layer " + path);
|
||||
|
||||
// call the actual implementation
|
||||
avmSyncService.resetLayer(path);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
// Execute
|
||||
txnHelper.doInTransaction(callback);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Utils.addErrorMessage(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -249,19 +271,42 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
{
|
||||
if ("content".equals(Application.getWizardManager().getCurrentStepName()))
|
||||
{
|
||||
if (this.formInstanceData != null)
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
|
||||
RetryingTransactionCallback<String> callback = new RetryingTransactionCallback<String>()
|
||||
{
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("clearing form instance data: " + this.formInstanceData.getPath());
|
||||
this.avmService.removeNode(this.formInstanceData.getPath());
|
||||
}
|
||||
if (this.renditions != null)
|
||||
{
|
||||
for (Rendition r : this.renditions)
|
||||
public String execute() throws Throwable
|
||||
{
|
||||
this.avmService.removeNode(r.getPath());
|
||||
if (formInstanceData != null)
|
||||
{
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("clearing form instance data: " + formInstanceData.getPath());
|
||||
|
||||
avmService.removeNode(formInstanceData.getPath());
|
||||
}
|
||||
|
||||
if (renditions != null)
|
||||
{
|
||||
for (Rendition r : renditions)
|
||||
{
|
||||
avmService.removeNode(r.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
// Execute
|
||||
txnHelper.doInTransaction(callback);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Utils.addErrorMessage(e.getMessage(), e);
|
||||
}
|
||||
|
||||
this.formInstanceData = null;
|
||||
this.renditions = null;
|
||||
}
|
||||
|
@@ -116,7 +116,14 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
||||
NodeRef report = ref.getChildRef();
|
||||
|
||||
String server = (String)this.nodeService.getProperty(report, WCMAppModel.PROP_DEPLOYSERVER);
|
||||
int version = (Integer)this.nodeService.getProperty(report, WCMAppModel.PROP_DEPLOYVERSION);
|
||||
|
||||
int version = -1;
|
||||
Serializable snapshotObj = nodeService.getProperty(report, WCMAppModel.PROP_DEPLOYVERSION);
|
||||
if (snapshotObj != null && snapshotObj instanceof Integer)
|
||||
{
|
||||
version = (Integer)snapshotObj;
|
||||
}
|
||||
|
||||
if ((version == this.versionToDeploy && selectedDeployTo.contains(server)) ||
|
||||
(version != this.versionToDeploy) || (allDeployToServers.contains(server) == false))
|
||||
{
|
||||
|
@@ -23,55 +23,47 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.component.UIViewRoot;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
import javax.faces.event.ValueChangeEvent;
|
||||
import javax.faces.model.DataModel;
|
||||
import javax.faces.model.ListDataModel;
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import org.alfresco.web.ui.common.component.UIListItems;
|
||||
import org.alfresco.web.ui.common.component.data.UIRichList;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.model.FileExistsException;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.*;
|
||||
import org.alfresco.service.cmr.search.*;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.wizard.BaseWizardBean;
|
||||
import org.alfresco.web.data.IDataContainer;
|
||||
import org.alfresco.web.data.QuickSort;
|
||||
import org.alfresco.web.forms.*;
|
||||
import org.alfresco.web.forms.Form;
|
||||
import org.alfresco.web.forms.FormInstanceData;
|
||||
import org.alfresco.web.forms.FormNotFoundException;
|
||||
import org.alfresco.web.forms.FormsService;
|
||||
import org.alfresco.web.forms.RenderingEngineTemplate;
|
||||
import org.alfresco.web.forms.RenderingEngineTemplateImpl;
|
||||
import org.alfresco.web.forms.Rendition;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.UIListItem;
|
||||
import org.alfresco.web.ui.wcm.WebResources;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.alfresco.web.ui.common.component.UIListItems;
|
||||
import org.alfresco.web.ui.common.component.data.UIRichList;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
/**
|
||||
* @author arielb
|
||||
@@ -79,7 +71,6 @@ import org.w3c.dom.Document;
|
||||
public class RegenerateRenditionsWizard
|
||||
extends BaseWizardBean
|
||||
{
|
||||
|
||||
public final String REGENERATE_SCOPE_ALL = "all";
|
||||
public final String REGENERATE_SCOPE_FORM = "form";
|
||||
public final String REGENERATE_SCOPE_RENDERING_ENGINE_TEMPLATE = "rendering_engine_template";
|
||||
@@ -115,7 +106,8 @@ public class RegenerateRenditionsWizard
|
||||
-1, AVMUtil.getCorrespondingPathInMainStore(r.getPath()),
|
||||
AVMDifference.NEWER));
|
||||
}
|
||||
LOGGER.debug("updating " + diffList.size() + " renditions in staging");
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("updating " + diffList.size() + " renditions in staging");
|
||||
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
|
||||
String description = null;
|
||||
final ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||
@@ -158,11 +150,6 @@ public class RegenerateRenditionsWizard
|
||||
{
|
||||
this.selectedForms = new String[] { this.browseBean.getDocument().getName() };
|
||||
}
|
||||
else if (this.browseBean.getDocument().hasAspect(WCMAppModel.ASPECT_RENDERING_ENGINE_TEMPLATE))
|
||||
{
|
||||
// System.err.println("how to handle ? " + this.browseBean.getDocument());
|
||||
// this.selectedRenderingEngineTemplates = new String[] { "*:
|
||||
}
|
||||
}
|
||||
else if (this.browseBean.getActionSpace() != null)
|
||||
{
|
||||
@@ -429,13 +416,14 @@ public class RegenerateRenditionsWizard
|
||||
final StoreRef storeRef = AVMNodeConverter.ToStoreRef(webProject.getStagingStore());
|
||||
sp.addStore(storeRef);
|
||||
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||
final StringBuilder query = new StringBuilder();
|
||||
final StringBuilder query = new StringBuilder(256);
|
||||
query.append("+ASPECT:\"" + WCMAppModel.ASPECT_FORM_INSTANCE_DATA + "\"");
|
||||
query.append("-ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
|
||||
query.append(" -ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
|
||||
query.append(" +@" + Repository.escapeQName(WCMAppModel.PROP_PARENT_FORM_NAME) +
|
||||
":\"" + f.getName() + "\"");
|
||||
|
||||
LOGGER.debug("running query " + query);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("running query " + query);
|
||||
sp.setQuery(query.toString());
|
||||
final ResultSet rs = this.searchService.query(sp);
|
||||
final List<FormInstanceData> result = new ArrayList<FormInstanceData>(rs.length());
|
||||
@@ -458,8 +446,8 @@ public class RegenerateRenditionsWizard
|
||||
query.append("+ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
|
||||
query.append(" +@" + Repository.escapeQName(WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE) +
|
||||
":\"" + ((RenderingEngineTemplateImpl)ret).getNodeRef() + "\"");
|
||||
|
||||
LOGGER.debug("running query " + query);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("running query " + query);
|
||||
sp.setQuery(query.toString());
|
||||
final ResultSet rs = this.searchService.query(sp);
|
||||
final List<Rendition> result = new ArrayList<Rendition>(rs.length());
|
||||
@@ -482,12 +470,12 @@ public class RegenerateRenditionsWizard
|
||||
final StoreRef storeRef = AVMNodeConverter.ToStoreRef(this.selectedWebProject.getStagingStore());
|
||||
sp.addStore(storeRef);
|
||||
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||
StringBuilder query = new StringBuilder();
|
||||
StringBuilder query = new StringBuilder(128);
|
||||
if (this.regenerateScope.equals(REGENERATE_SCOPE_ALL) ||
|
||||
this.regenerateScope.equals(REGENERATE_SCOPE_FORM))
|
||||
{
|
||||
query.append("+ASPECT:\"" + WCMAppModel.ASPECT_FORM_INSTANCE_DATA + "\"");
|
||||
query.append("-ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
|
||||
query.append(" -ASPECT:\"" + WCMAppModel.ASPECT_RENDITION + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -531,13 +519,15 @@ public class RegenerateRenditionsWizard
|
||||
}
|
||||
catch (FormNotFoundException fnfe)
|
||||
{
|
||||
LOGGER.debug(fnfe);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug(fnfe);
|
||||
}
|
||||
}
|
||||
query.append(") ");
|
||||
}
|
||||
|
||||
LOGGER.debug("running query " + query);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("running query " + query);
|
||||
sp.setQuery(query.toString());
|
||||
final ResultSet rs = this.searchService.query(sp);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
|
@@ -346,12 +346,15 @@ public final class FormsService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of web project nodes that reference a form name in their model
|
||||
*/
|
||||
private List<NodeRef> getFormConfigurations(final String formName)
|
||||
{
|
||||
final String query =
|
||||
"+TYPE:\"" + WCMAppModel.TYPE_WEBFORM +
|
||||
"\" +@" + Repository.escapeQName(WCMAppModel.PROP_FORMNAME) +
|
||||
":\"" + QueryParser.escape(formName) + "\"";
|
||||
"+TYPE:\"" + WCMAppModel.TYPE_WEBFORM + "\"" +
|
||||
" +@" + Repository.escapeQName(WCMAppModel.PROP_FORMNAME) +
|
||||
":\"" + formName + "\"";
|
||||
final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
|
||||
SearchService.LANGUAGE_LUCENE,
|
||||
query);
|
||||
|
@@ -25,6 +25,7 @@
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -44,7 +45,6 @@ import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
import org.alfresco.web.bean.wcm.DeploymentMonitor;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -80,6 +80,7 @@ public class UIDeployWebsite extends UIInput
|
||||
return "org.alfresco.faces.DeployWebsite";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void decode(FacesContext context)
|
||||
{
|
||||
@@ -186,14 +187,24 @@ public class UIDeployWebsite extends UIInput
|
||||
for (ChildAssociationRef ref : deployReportRefs)
|
||||
{
|
||||
NodeRef report = ref.getChildRef();
|
||||
Boolean success = (Boolean)nodeService.getProperty(report,
|
||||
WCMAppModel.PROP_DEPLOYSUCCESSFUL);
|
||||
int deployedVersion = (Integer)nodeService.getProperty(report,
|
||||
WCMAppModel.PROP_DEPLOYVERSION);
|
||||
if (success.booleanValue() && (deployingVersion == deployedVersion))
|
||||
if (report != null)
|
||||
{
|
||||
serversAlreadyDeployed.add((String)nodeService.getProperty(report,
|
||||
WCMAppModel.PROP_DEPLOYSERVER));
|
||||
int deployedVersion = -1;
|
||||
Boolean success = (Boolean)nodeService.getProperty(report,
|
||||
WCMAppModel.PROP_DEPLOYSUCCESSFUL);
|
||||
|
||||
Serializable deployVersionObj = nodeService.getProperty(report,
|
||||
WCMAppModel.PROP_DEPLOYVERSION);
|
||||
if (deployVersionObj != null && deployVersionObj instanceof Integer)
|
||||
{
|
||||
deployedVersion = (Integer)deployVersionObj;
|
||||
}
|
||||
|
||||
if (success != null && success.booleanValue() && (deployingVersion == deployedVersion))
|
||||
{
|
||||
serversAlreadyDeployed.add((String)nodeService.getProperty(report,
|
||||
WCMAppModel.PROP_DEPLOYSERVER));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,7 @@
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -208,13 +209,27 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
||||
|
||||
// extract the information we need to display
|
||||
String server = (String)nodeService.getProperty(deploymentReport, WCMAppModel.PROP_DEPLOYSERVER);
|
||||
Integer snapshot = (Integer)nodeService.getProperty(deploymentReport, WCMAppModel.PROP_DEPLOYVERSION);
|
||||
String creator = (String)nodeService.getProperty(deploymentReport, ContentModel.PROP_CREATOR);
|
||||
Date startTime = (Date)nodeService.getProperty(deploymentReport, WCMAppModel.PROP_DEPLOYSTARTTIME);
|
||||
String started = null;
|
||||
if (startTime != null)
|
||||
{
|
||||
started = Utils.getDateTimeFormat(context).format(startTime);
|
||||
}
|
||||
|
||||
Date endTime = (Date)nodeService.getProperty(deploymentReport, WCMAppModel.PROP_DEPLOYENDTIME);
|
||||
String started = Utils.getDateTimeFormat(context).format(startTime);
|
||||
String finished = Utils.getDateTimeFormat(context).format(endTime);
|
||||
String finished = null;
|
||||
if (endTime != null)
|
||||
{
|
||||
finished = Utils.getDateTimeFormat(context).format(endTime);
|
||||
}
|
||||
|
||||
Boolean success = (Boolean)nodeService.getProperty(deploymentReport, WCMAppModel.PROP_DEPLOYSUCCESSFUL);
|
||||
if (success == null)
|
||||
{
|
||||
success = Boolean.FALSE;
|
||||
}
|
||||
|
||||
String failReason = (String)nodeService.getProperty(deploymentReport, WCMAppModel.PROP_DEPLOYFAILEDREASON);
|
||||
String content = "";
|
||||
ContentReader reader = contentService.getReader(deploymentReport, ContentModel.PROP_CONTENT);
|
||||
@@ -231,6 +246,13 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
||||
}
|
||||
}
|
||||
|
||||
int snapshot = -1;
|
||||
Serializable snapshotObj = nodeService.getProperty(deploymentReport, WCMAppModel.PROP_DEPLOYVERSION);
|
||||
if (snapshotObj != null && snapshotObj instanceof Integer)
|
||||
{
|
||||
snapshot = (Integer)snapshotObj;
|
||||
}
|
||||
|
||||
out.write("<table cellspacing='0' cellpadding='2' border='0' width='100%'>");
|
||||
out.write("<tr><td width='40' valign='top'><img src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
@@ -261,7 +283,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
||||
out.write("<div style='margin-top: 6px;'>");
|
||||
out.write(Application.getMessage(context, "snapshot"));
|
||||
out.write(": ");
|
||||
out.write(snapshot.toString());
|
||||
out.write(Integer.toString(snapshot));
|
||||
out.write("</div>");
|
||||
out.write("<div style='margin-top: 3px;'>");
|
||||
out.write(Application.getMessage(context, "deploy_started"));
|
||||
|
@@ -51,7 +51,7 @@
|
||||
value="#{msg.web_project}:"/>
|
||||
<h:selectOneMenu id="selectone-webproject"
|
||||
style="width:100%;"
|
||||
onclick="this.form.submit()"
|
||||
onchange="this.form.submit()"
|
||||
value="#{WizardManager.bean.selectedWebProject}">
|
||||
<f:selectItems id="selectitems-webproject"
|
||||
value="#{WizardManager.bean.webProjectChoices}"/>
|
||||
|
Reference in New Issue
Block a user