mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Point checkin.
Virt server notification is still needed for submit & rollback ops. AVMHostConfig.java Made virt server clean up virtual webapps in work dir when sandboxes and/or web projects are deleted. AVMUrlValve.java Made virt server respond with an error page when a bad virtual hostname is accessed (rather than just put up a blank page and throw an exception in the logfile). The error page is currently hard-coded in English (hopefully that will change soon). AVMEditBean.java Inserted more virt server notifications DeleteWebsiteDialog.java Inserted virt server notification git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4908 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -248,9 +248,11 @@ public class AVMEditBean
|
|||||||
final String formName = (String)pv.getValue(DataTypeDefinition.TEXT);
|
final String formName = (String)pv.getValue(DataTypeDefinition.TEXT);
|
||||||
final WebProject wp = new WebProject(this.getAvmNode().getPath());
|
final WebProject wp = new WebProject(this.getAvmNode().getPath());
|
||||||
this.form = wp.getForm(formName);
|
this.form = wp.getForm(formName);
|
||||||
LOGGER.debug("loaded form " + this.form +
|
|
||||||
", form name " + formName +
|
if (LOGGER.isDebugEnabled())
|
||||||
", for " + this.getAvmNode().getPath());
|
LOGGER.debug("loaded form " + this.form +
|
||||||
|
", form name " + formName +
|
||||||
|
", for " + this.getAvmNode().getPath());
|
||||||
}
|
}
|
||||||
return this.form;
|
return this.form;
|
||||||
}
|
}
|
||||||
@@ -317,13 +319,16 @@ public class AVMEditBean
|
|||||||
{
|
{
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug(avmPath + " is a rendition, editing primary rendition instead");
|
LOGGER.debug(avmPath + " is a rendition, editing primary rendition instead");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final FormInstanceData fid =
|
final FormInstanceData fid =
|
||||||
new RenditionImpl(AVMNodeConverter.ToNodeRef(-1, avmPath)).getPrimaryFormInstanceData();
|
new RenditionImpl(AVMNodeConverter.ToNodeRef(-1, avmPath)).getPrimaryFormInstanceData();
|
||||||
avmPath = fid.getPath();
|
avmPath = fid.getPath();
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("Editing primary form instance data " + avmPath);
|
LOGGER.debug("Editing primary form instance data " + avmPath);
|
||||||
|
|
||||||
this.avmBrowseBean.setAvmActionNode(new AVMNode(this.avmService.lookup(-1, avmPath)));
|
this.avmBrowseBean.setAvmActionNode(new AVMNode(this.avmService.lookup(-1, avmPath)));
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException fnfe)
|
catch (FileNotFoundException fnfe)
|
||||||
@@ -340,13 +345,16 @@ public class AVMEditBean
|
|||||||
String storeName = AVMConstants.getStoreName(avmPath);
|
String storeName = AVMConstants.getStoreName(avmPath);
|
||||||
storeName = AVMConstants.getCorrespondingPreviewStoreName(storeName);
|
storeName = AVMConstants.getCorrespondingPreviewStoreName(storeName);
|
||||||
final String path = AVMConstants.buildStoreRootPath(storeName);
|
final String path = AVMConstants.buildStoreRootPath(storeName);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("reseting layer " + path);
|
LOGGER.debug("reseting layer " + path);
|
||||||
|
|
||||||
this.avmSyncService.resetLayer(path);
|
this.avmSyncService.resetLayer(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("Editing AVM node: " + avmPath);
|
LOGGER.debug("Editing AVM node: " + avmPath);
|
||||||
|
|
||||||
ContentReader reader = this.avmService.getContentReader(-1, avmPath);
|
ContentReader reader = this.avmService.getContentReader(-1, avmPath);
|
||||||
if (reader != null)
|
if (reader != null)
|
||||||
{
|
{
|
||||||
@@ -400,8 +408,10 @@ public class AVMEditBean
|
|||||||
AVMNode node = getAvmNode();
|
AVMNode node = getAvmNode();
|
||||||
if (node != null)
|
if (node != null)
|
||||||
{
|
{
|
||||||
|
// Possibly notify virt server
|
||||||
|
AVMConstants.updateVServerWebapp(node.getPath(), false);
|
||||||
|
|
||||||
resetState();
|
resetState();
|
||||||
|
|
||||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,7 +431,10 @@ public class AVMEditBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String avmPath = avmNode.getPath();
|
final String avmPath = avmNode.getPath();
|
||||||
LOGGER.debug("saving " + avmPath);
|
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("saving " + avmPath);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
|
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
|
||||||
@@ -446,7 +459,10 @@ public class AVMEditBean
|
|||||||
@Override
|
@Override
|
||||||
public Form getForm() { return AVMEditBean.this.getForm(); }
|
public Form getForm() { return AVMEditBean.this.getForm(); }
|
||||||
};
|
};
|
||||||
LOGGER.debug("regenerating renditions of " + fid);
|
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("regenerating renditions of " + fid);
|
||||||
|
|
||||||
for (Rendition rendition : fid.getRenditions())
|
for (Rendition rendition : fid.getRenditions())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -455,6 +471,7 @@ public class AVMEditBean
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
||||||
Utils.addErrorMessage("error regenerating " + rendition.getName() +
|
Utils.addErrorMessage("error regenerating " + rendition.getName() +
|
||||||
" using " + rendition.getRenderingEngineTemplate().getName() +
|
" using " + rendition.getRenderingEngineTemplate().getName() +
|
||||||
": " + e.getMessage(),
|
": " + e.getMessage(),
|
||||||
@@ -462,7 +479,10 @@ public class AVMEditBean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
final NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
|
final NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
|
||||||
LOGGER.debug("updating " + uploadedFiles.length + " uploaded files");
|
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("updating " + uploadedFiles.length + " uploaded files");
|
||||||
|
|
||||||
final List<AVMDifference> diffList = new ArrayList<AVMDifference>(uploadedFiles.length);
|
final List<AVMDifference> diffList = new ArrayList<AVMDifference>(uploadedFiles.length);
|
||||||
for (NodeRef uploadedFile : uploadedFiles)
|
for (NodeRef uploadedFile : uploadedFiles)
|
||||||
{
|
{
|
||||||
@@ -473,7 +493,8 @@ public class AVMEditBean
|
|||||||
}
|
}
|
||||||
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
|
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Possibly notify virt server
|
||||||
AVMConstants.updateVServerWebapp(avmNode.getPath(), false);
|
AVMConstants.updateVServerWebapp(avmNode.getPath(), false);
|
||||||
|
|
||||||
resetState();
|
resetState();
|
||||||
@@ -519,6 +540,9 @@ public class AVMEditBean
|
|||||||
|
|
||||||
// commit the transaction
|
// commit the transaction
|
||||||
tx.commit();
|
tx.commit();
|
||||||
|
|
||||||
|
// Possibly notify virt server
|
||||||
|
AVMConstants.updateVServerWebapp(node.getPath(), false);
|
||||||
|
|
||||||
// clear action context
|
// clear action context
|
||||||
resetState();
|
resetState();
|
||||||
|
@@ -48,6 +48,31 @@ public class DeleteWebsiteDialog extends DeleteSpaceDialog
|
|||||||
|
|
||||||
// delete all attached website sandboxes in reverse order to the layering
|
// delete all attached website sandboxes in reverse order to the layering
|
||||||
String storeRoot = (String)websiteNode.getProperties().get(WCMAppModel.PROP_AVMSTORE);
|
String storeRoot = (String)websiteNode.getProperties().get(WCMAppModel.PROP_AVMSTORE);
|
||||||
|
|
||||||
|
// Notifiy virtualization server about removing this website
|
||||||
|
//
|
||||||
|
// Implementation note:
|
||||||
|
//
|
||||||
|
// Because the removal of virtual webapps in the virtualization
|
||||||
|
// server is recursive, it only needs to be given the name of
|
||||||
|
// the main staging store.
|
||||||
|
//
|
||||||
|
// This notification must occur *prior* to purging content
|
||||||
|
// within the AVM because the virtualization server must list
|
||||||
|
// the avm_webapps dir in each store to discover which
|
||||||
|
// virtual webapps must be unloaded. The virtualization
|
||||||
|
// server traverses the sandbox's stores in most-to-least
|
||||||
|
// dependent order, so clients don't have to worry about
|
||||||
|
// accessing a preview layer whose main layer has been torn
|
||||||
|
// out from under it.
|
||||||
|
//
|
||||||
|
// It does not matter what webapp name we give here, so "/ROOT"
|
||||||
|
// is as sensible as anything else. It's all going away.
|
||||||
|
|
||||||
|
String sandbox = AVMConstants.buildStagingStoreName(storeRoot);
|
||||||
|
String path = AVMConstants.buildStoreWebappPath(sandbox, "/ROOT");
|
||||||
|
AVMConstants.removeVServerWebapp(path, true);
|
||||||
|
|
||||||
|
|
||||||
// get the list of users who have a sandbox in the website
|
// get the list of users who have a sandbox in the website
|
||||||
List<ChildAssociationRef> userInfoRefs = nodeService.getChildAssocs(
|
List<ChildAssociationRef> userInfoRefs = nodeService.getChildAssocs(
|
||||||
|
Reference in New Issue
Block a user