. Fix for missing image issue spotted by Linton

. Code cleanup (syncing of code styles, tabs, missing "if (logger.isDebugEnabled())" calls…)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5008 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-02-02 09:03:38 +00:00
parent bbba9d10cd
commit 0f04450926
8 changed files with 93 additions and 111 deletions

View File

@@ -167,6 +167,7 @@ public class AVMBrowseBean implements IContextListener
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this); UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
} }
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Bean property getters and setters // Bean property getters and setters

View File

@@ -761,5 +761,4 @@ public final class AVMConstants
private final static Pattern SANDBOX_RELATIVE_PATH_PATTERN = private final static Pattern SANDBOX_RELATIVE_PATH_PATTERN =
Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW + Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW +
"/" + JNDIConstants.DIR_DEFAULT_APPBASE + ")(.*)"); "/" + JNDIConstants.DIR_DEFAULT_APPBASE + ")(.*)");
} }

View File

@@ -226,7 +226,8 @@ public class CreateWebContentWizard extends BaseContentWizard
final int step = Application.getWizardManager().getCurrentStep(); final int step = Application.getWizardManager().getCurrentStep();
if (step == 2) if (step == 2)
{ {
LOGGER.debug("clearing form instance data"); if (LOGGER.isDebugEnabled())
LOGGER.debug("clearing form instance data");
if (this.formInstanceData != null) if (this.formInstanceData != null)
{ {
this.avmService.removeNode(this.formInstanceData.getPath()); this.avmService.removeNode(this.formInstanceData.getPath());
@@ -302,16 +303,17 @@ public class CreateWebContentWizard extends BaseContentWizard
// reset all paths and structures to the main store // reset all paths and structures to the main store
this.createdPath = AVMConstants.getCorrespondingPathInMainStore(this.createdPath); this.createdPath = AVMConstants.getCorrespondingPathInMainStore(this.createdPath);
LOGGER.debug("reset path " + this.createdPath + " to main store"); if (LOGGER.isDebugEnabled())
LOGGER.debug("reset path " + this.createdPath + " to main store");
boolean form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null); boolean form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null);
if (form) if (form)
{ {
this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath)); this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath));
this.renditions = this.formInstanceData.getRenditions(); this.renditions = this.formInstanceData.getRenditions();
LOGGER.debug("reset form instance data " + this.formInstanceData.getName() + if (LOGGER.isDebugEnabled())
" and " + this.renditions.size() + " to main store"); LOGGER.debug("reset form instance data " + this.formInstanceData.getName() +
" and " + this.renditions.size() + " to main store");
} }
if (this.startWorkflow) if (this.startWorkflow)
{ {
@@ -367,8 +369,8 @@ public class CreateWebContentWizard extends BaseContentWizard
srcPaths.add(AVMConstants.getCorrespondingPath(this.createdPath, sandboxName)); srcPaths.add(AVMConstants.getCorrespondingPath(this.createdPath, sandboxName));
} }
LOGGER.debug("creating workflow package with " + srcPaths.size() + " files"); if (LOGGER.isDebugEnabled())
LOGGER.debug("creating workflow package with " + srcPaths.size() + " files");
// Create workflow sandbox for workflow package // Create workflow sandbox for workflow package
SandboxInfo sandboxInfo = SandboxFactory.createWorkflowSandbox(storeId); SandboxInfo sandboxInfo = SandboxFactory.createWorkflowSandbox(storeId);

View File

@@ -122,6 +122,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
/** Data for virtualization server notification */ /** Data for virtualization server notification */
private SandboxInfo sandboxInfo; private SandboxInfo sandboxInfo;
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Wizard implementation // Wizard implementation
@@ -212,27 +213,24 @@ public class CreateWebsiteWizard extends BaseWizardBean
return outcome; return outcome;
} }
/**
* @see org.alfresco.web.bean.dialog.BaseDialogBean#doPostCommitProcessing(javax.faces.context.FacesContext, java.lang.String)
*/
@Override @Override
protected String doPostCommitProcessing(FacesContext context, String outcome) protected String doPostCommitProcessing(FacesContext context, String outcome)
{ {
// TODO: ask about isStandalone() if (this.sandboxInfo != null)
// in InviteWebsiteUsersWizard
if ( this.sandboxInfo != null )
{ {
String newStoreName = // update the virtualisation server with the default ROOT webapp path
AVMConstants.buildStagingStoreName( sandboxInfo.getMainStoreName()); // performed after the main txn has committed successfully
String newStoreName = AVMConstants.buildStagingStoreName(sandboxInfo.getMainStoreName());
String path = AVMConstants.buildStoreWebappPath(
newStoreName, "ROOT" String path = AVMConstants.buildStoreWebappPath(newStoreName, WEBAPP_DEFAULT);
);
AVMConstants.updateVServerWebapp(path, true);
AVMConstants.updateVServerWebapp(path, true); }
} return outcome;
return outcome;
} }
/** /**
* Persist the forms, templates, workflows and workflow defaults to the model for this web project * Persist the forms, templates, workflows and workflow defaults to the model for this web project

View File

@@ -196,33 +196,29 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
} }
/** /**
* Handle notification to the virtualization server * Handle notification to the virtualization server
* (this needs to occur after the sandbox is created). * (this needs to occur after the sandbox is created in the main txn).
*/ */
@Override @Override
protected String doPostCommitProcessing(FacesContext context, String outcome) protected String doPostCommitProcessing(FacesContext context, String outcome)
{ {
// reload virtualisation server for webapp in this web project // reload virtualisation server for webapp in this web project
if (isStandalone()) if (isStandalone())
{ {
for (SandboxInfo sandboxInfo : this.sandboxInfoList) for (SandboxInfo sandboxInfo : this.sandboxInfoList)
{ {
String newlyInvitedStoreName = String newlyInvitedStoreName = AVMConstants.buildStagingStoreName(
AVMConstants.buildStagingStoreName( sandboxInfo.getMainStoreName());
sandboxInfo.getMainStoreName());
String path = AVMConstants.buildStoreWebappPath(
String path = newlyInvitedStoreName, this.avmBrowseBean.getWebapp());
AVMConstants.buildStoreWebappPath(
newlyInvitedStoreName, this.avmBrowseBean.getWebapp()); AVMConstants.updateVServerWebapp(path, true);
}
AVMConstants.updateVServerWebapp(path, true); }
} return outcome;
}
return outcome;
} }
/** /**
* Find all nested user authorities contained with an authority * Find all nested user authorities contained with an authority
* *

View File

@@ -465,8 +465,6 @@ public final class SandboxFactory
new PropertyValue(DataTypeDefinition.INT, distance)); new PropertyValue(DataTypeDefinition.INT, distance));
} }
/** /**
* Debug helper method to dump the properties of a store * Debug helper method to dump the properties of a store
* *

View File

@@ -88,7 +88,6 @@ public class SubmitDialog extends BaseDialogBean
private Map<String, FormWorkflowWrapper> formWorkflowMap; private Map<String, FormWorkflowWrapper> formWorkflowMap;
private List<UIListItem> workflowItems; private List<UIListItem> workflowItems;
// The virtualization server might need to be notified // The virtualization server might need to be notified
// because one or more of the files submitted could alter // because one or more of the files submitted could alter
// the behavior the virtual webapp in the target of the submit. // the behavior the virtual webapp in the target of the submit.
@@ -97,7 +96,6 @@ public class SubmitDialog extends BaseDialogBean
// This must take place after the transaction has been completed; // This must take place after the transaction has been completed;
// therefore, a variable is needed to store the path to the // therefore, a variable is needed to store the path to the
// updated webapp so it can happen in doPostCommitProcessing. // updated webapp so it can happen in doPostCommitProcessing.
//
private String virtUpdatePath; private String virtUpdatePath;
protected AVMService avmService; protected AVMService avmService;
@@ -247,9 +245,8 @@ public class SubmitDialog extends BaseDialogBean
{ {
// Example srcPath: // Example srcPath:
// mysite--alice:/www/avm_webapps/ROOT/foo.txt // mysite--alice:/www/avm_webapps/ROOT/foo.txt
String srcPath = wrapper.getDescriptor().getPath(); String srcPath = wrapper.getDescriptor().getPath();
// We *always* want to update virtualization server // We *always* want to update virtualization server
// when a workflow sandbox is given data in the // when a workflow sandbox is given data in the
// context of a submit workflow. Without this, // context of a submit workflow. Without this,
@@ -266,41 +263,35 @@ public class SubmitDialog extends BaseDialogBean
// the submiot list (even if it's not in WEB-INF), // the submiot list (even if it's not in WEB-INF),
// and force the virt server notification after the // and force the virt server notification after the
// transaction has completed via doPostCommitProcessing. // transaction has completed via doPostCommitProcessing.
if (this.virtUpdatePath == null)
if ( this.virtUpdatePath == null )
{ {
// Example workflow main store name: // Example workflow main store name:
// mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652 // mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652
String workflowMainStoreName = sandboxInfo.getMainStoreName(); String workflowMainStoreName = sandboxInfo.getMainStoreName();
// The virtUpdatePath looks just like the srcPath // The virtUpdatePath looks just like the srcPath
// except that it belongs to a the main store of // except that it belongs to a the main store of
// the workflow sandbox instead of the sandbox // the workflow sandbox instead of the sandbox
// that originated the submit. // that originated the submit.
this.virtUpdatePath =
this.virtUpdatePath = workflowMainStoreName + workflowMainStoreName +
srcPath.substring( srcPath.substring(srcPath.indexOf(':'),srcPath.length());
srcPath.indexOf(':'),
srcPath.length()
);
} }
srcPaths.add(srcPath); srcPaths.add(srcPath);
} }
final NodeRef workflowPackage = final NodeRef workflowPackage =
AVMWorkflowUtil.createWorkflowPackage(srcPaths, AVMWorkflowUtil.createWorkflowPackage(srcPaths,
sandboxInfo, sandboxInfo,
path, path,
avmSubmittedAspect, avmSubmittedAspect,
this.avmSyncService, this.avmSyncService,
this.avmService, this.avmService,
this.workflowService, this.workflowService,
this.nodeService); this.nodeService);
params.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage); params.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
// add submission parameters // add submission parameters
params.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, getComment()); params.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, getComment());
@@ -336,7 +327,7 @@ public class SubmitDialog extends BaseDialogBean
List<AVMDifference> diffs = new ArrayList<AVMDifference>(items.size()); List<AVMDifference> diffs = new ArrayList<AVMDifference>(items.size());
// flag indicating if virt server update is already implied // flag indicating if virt server update is already implied
boolean update_vserver = false; boolean updateVserver = false;
for (ItemWrapper wrapper : items) for (ItemWrapper wrapper : items)
{ {
@@ -344,21 +335,21 @@ public class SubmitDialog extends BaseDialogBean
String destPath = stagingPath + wrapper.getPath(); String destPath = stagingPath + wrapper.getPath();
AVMDifference diff = new AVMDifference(-1, srcPath, -1, destPath, AVMDifference.NEWER); AVMDifference diff = new AVMDifference(-1, srcPath, -1, destPath, AVMDifference.NEWER);
diffs.add(diff); diffs.add(diff);
// If nothing has required notifying the virtualization server // If nothing has required notifying the virtualization server
// so far, check to see if destPath forces a notification // so far, check to see if destPath forces a notification
// (e.g.: it might be a path to a jar file within WEB-INF/lib). // (e.g.: it might be a path to a jar file within WEB-INF/lib).
if (!updateVserver)
if ( ! update_vserver )
{ {
// Examples of destPath that require virt server notification: // Examples of destPath that require virt server notification:
// //
// mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml // mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml
// mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar // mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar
updateVserver = VirtServerUtils.requiresUpdateNotification( destPath );
update_vserver = VirtServerUtils.requiresUpdateNotification( destPath ); if (updateVserver)
{
if ( update_vserver ) { this.virtUpdatePath = destPath; } this.virtUpdatePath = destPath;
}
} }
} }
@@ -372,28 +363,25 @@ public class SubmitDialog extends BaseDialogBean
} }
/** /**
* Handle notification to the virtualization server * Handle notification to the virtualization server
* (this needs to occur after the sandbox is updated). * (this needs to occur after the sandbox is updated).
*/ */
@Override @Override
protected String doPostCommitProcessing(FacesContext context, String outcome) protected String doPostCommitProcessing(FacesContext context, String outcome)
{ {
// Force the update because we've already determined // Force the update because we've already determined
// that update_path requires virt server notification. // that update_path requires virt server notification.
if (this.virtUpdatePath != null)
if ( this.virtUpdatePath != null) {
{ // Examples of destPath that require virt server notification:
// Examples of destPath that require virt server notification: //
// // mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml
// mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml // mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar
// mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar AVMConstants.updateVServerWebapp(this.virtUpdatePath, true);
}
AVMConstants.updateVServerWebapp( this.virtUpdatePath, true ); return outcome;
}
return outcome;
} }
/** /**
* @see org.alfresco.web.bean.dialog.BaseDialogBean#getFinishButtonDisabled() * @see org.alfresco.web.bean.dialog.BaseDialogBean#getFinishButtonDisabled()
*/ */

View File

@@ -102,7 +102,7 @@
<tr> <tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td> <td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td> <td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_6.gif" width="4" height="9"></td> <td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr> </tr>
<%-- infomation panel --%> <%-- infomation panel --%>