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:
Jon Cox
2007-01-23 23:37:23 +00:00
parent f0694057ac
commit 2ba25fd482
2 changed files with 59 additions and 10 deletions

View File

@@ -248,6 +248,8 @@ public class AVMEditBean
final String formName = (String)pv.getValue(DataTypeDefinition.TEXT);
final WebProject wp = new WebProject(this.getAvmNode().getPath());
this.form = wp.getForm(formName);
if (LOGGER.isDebugEnabled())
LOGGER.debug("loaded form " + this.form +
", form name " + formName +
", for " + this.getAvmNode().getPath());
@@ -317,13 +319,16 @@ public class AVMEditBean
{
if (LOGGER.isDebugEnabled())
LOGGER.debug(avmPath + " is a rendition, editing primary rendition instead");
try
{
final FormInstanceData fid =
new RenditionImpl(AVMNodeConverter.ToNodeRef(-1, avmPath)).getPrimaryFormInstanceData();
avmPath = fid.getPath();
if (LOGGER.isDebugEnabled())
LOGGER.debug("Editing primary form instance data " + avmPath);
this.avmBrowseBean.setAvmActionNode(new AVMNode(this.avmService.lookup(-1, avmPath)));
}
catch (FileNotFoundException fnfe)
@@ -340,13 +345,16 @@ public class AVMEditBean
String storeName = AVMConstants.getStoreName(avmPath);
storeName = AVMConstants.getCorrespondingPreviewStoreName(storeName);
final String path = AVMConstants.buildStoreRootPath(storeName);
if (LOGGER.isDebugEnabled())
LOGGER.debug("reseting layer " + path);
this.avmSyncService.resetLayer(path);
}
if (LOGGER.isDebugEnabled())
LOGGER.debug("Editing AVM node: " + avmPath);
ContentReader reader = this.avmService.getContentReader(-1, avmPath);
if (reader != null)
{
@@ -400,8 +408,10 @@ public class AVMEditBean
AVMNode node = getAvmNode();
if (node != null)
{
resetState();
// Possibly notify virt server
AVMConstants.updateVServerWebapp(node.getPath(), false);
resetState();
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
}
@@ -421,7 +431,10 @@ public class AVMEditBean
}
final String avmPath = avmNode.getPath();
if (LOGGER.isDebugEnabled())
LOGGER.debug("saving " + avmPath);
try
{
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
@@ -446,7 +459,10 @@ public class AVMEditBean
@Override
public Form getForm() { return AVMEditBean.this.getForm(); }
};
if (LOGGER.isDebugEnabled())
LOGGER.debug("regenerating renditions of " + fid);
for (Rendition rendition : fid.getRenditions())
{
try
@@ -455,6 +471,7 @@ public class AVMEditBean
}
catch (Exception e)
{
Utils.addErrorMessage("error regenerating " + rendition.getName() +
" using " + rendition.getRenderingEngineTemplate().getName() +
": " + e.getMessage(),
@@ -462,7 +479,10 @@ public class AVMEditBean
}
}
final NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
if (LOGGER.isDebugEnabled())
LOGGER.debug("updating " + uploadedFiles.length + " uploaded files");
final List<AVMDifference> diffList = new ArrayList<AVMDifference>(uploadedFiles.length);
for (NodeRef uploadedFile : uploadedFiles)
{
@@ -474,6 +494,7 @@ public class AVMEditBean
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
}
// Possibly notify virt server
AVMConstants.updateVServerWebapp(avmNode.getPath(), false);
resetState();
@@ -520,6 +541,9 @@ public class AVMEditBean
// commit the transaction
tx.commit();
// Possibly notify virt server
AVMConstants.updateVServerWebapp(node.getPath(), false);
// clear action context
resetState();

View File

@@ -49,6 +49,31 @@ public class DeleteWebsiteDialog extends DeleteSpaceDialog
// delete all attached website sandboxes in reverse order to the layering
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
List<ChildAssociationRef> userInfoRefs = nodeService.getChildAssocs(
websiteNode.getNodeRef(), WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL);