regenerate html output after editing xml asset.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3559 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-08-21 23:56:02 +00:00
parent 80bf0acd64
commit 6d52906338
5 changed files with 192 additions and 79 deletions

View File

@@ -45,6 +45,8 @@ import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.templating.OutputUtil;
import org.alfresco.web.templating.TemplatingService;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.apache.commons.logging.Log;
@@ -374,8 +376,8 @@ public class CheckinCheckoutBean
*/
private Node setupContentDocument(String id)
{
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current document to: " + id);
if (LOGGER.isDebugEnabled())
LOGGER.debug("Setup for action, setting current document to: " + id);
Node node = null;
@@ -425,14 +427,14 @@ public class CheckinCheckoutBean
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin();
if (logger.isDebugEnabled())
logger.debug("Trying to checkout content node Id: " + node.getId());
if (LOGGER.isDebugEnabled())
LOGGER.debug("Trying to checkout content node Id: " + node.getId());
// checkout the node content to create a working copy
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("Checkout copy location: " + getCopyLocation());
logger.debug("Selected Space Id: " + this.selectedSpaceId);
LOGGER.debug("Checkout copy location: " + getCopyLocation());
LOGGER.debug("Selected Space Id: " + this.selectedSpaceId);
}
NodeRef workingCopyRef;
if (getCopyLocation().equals(COPYLOCATION_OTHER) && this.selectedSpaceId != null)
@@ -476,7 +478,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: checkoutFile called without a current Document!");
LOGGER.warn("WARNING: checkoutFile called without a current Document!");
}
return outcome;
@@ -501,7 +503,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: checkoutFileOK called without a current WorkingDocument!");
LOGGER.warn("WARNING: checkoutFileOK called without a current WorkingDocument!");
}
return outcome;
@@ -526,7 +528,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: editFileOK called without a current Document!");
LOGGER.warn("WARNING: editFileOK called without a current Document!");
}
return outcome;
@@ -618,15 +620,23 @@ public class CheckinCheckoutBean
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin();
if (logger.isDebugEnabled())
logger.debug("Trying to update content node Id: " + node.getId());
if (LOGGER.isDebugEnabled())
LOGGER.debug("Trying to update content node Id: " + node.getId());
// get an updating writer that we can use to modify the content on the current node
ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
writer.putContent(this.editorOutput);
// commit the transaction
tx.commit();
if (nodeService.getProperty(node.getNodeRef(),
TemplatingService.TT_QNAME) != null)
{
OutputUtil.regenerate(node.getNodeRef(),
this.contentService,
this.nodeService);
}
// clean up and clear action context
clearUpload();
@@ -646,7 +656,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: editInlineOK called without a current Document!");
LOGGER.warn("WARNING: editInlineOK called without a current Document!");
}
return outcome;
@@ -679,7 +689,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: undoCheckout called without a current WorkingDocument!");
LOGGER.warn("WARNING: undoCheckout called without a current WorkingDocument!");
}
return outcome;
@@ -728,7 +738,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: undoCheckout called without a current WorkingDocument!");
LOGGER.warn("WARNING: undoCheckout called without a current WorkingDocument!");
}
return outcome;
@@ -752,8 +762,8 @@ public class CheckinCheckoutBean
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin();
if (logger.isDebugEnabled())
logger.debug("Trying to checkin content node Id: " + node.getId());
if (LOGGER.isDebugEnabled())
LOGGER.debug("Trying to checkin content node Id: " + node.getId());
// we can either checkin the content from the current working copy node
// which would have been previously updated by the user
@@ -815,7 +825,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: checkinFileOK called without a current Document!");
LOGGER.warn("WARNING: checkinFileOK called without a current Document!");
}
return outcome;
@@ -839,8 +849,8 @@ public class CheckinCheckoutBean
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin();
if (logger.isDebugEnabled())
logger.debug("Trying to update content node Id: " + node.getId());
if (LOGGER.isDebugEnabled())
LOGGER.debug("Trying to update content node Id: " + node.getId());
// get an updating writer that we can use to modify the content on the current node
ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
@@ -865,7 +875,7 @@ public class CheckinCheckoutBean
}
else
{
logger.warn("WARNING: updateFileOK called without a current Document!");
LOGGER.warn("WARNING: updateFileOK called without a current Document!");
}
return outcome;
@@ -910,7 +920,7 @@ public class CheckinCheckoutBean
// ------------------------------------------------------------------------------
// Private data
private static Log logger = LogFactory.getLog(CheckinCheckoutBean.class);
private static final Log LOGGER = LogFactory.getLog(CheckinCheckoutBean.class);
/** I18N messages */
private static final String MSG_ERROR_CHECKIN = "error_checkin";

View File

@@ -78,16 +78,14 @@ public class CreateContentWizard extends BaseContentWizard
this.templateTypeName);
TemplatingService ts = TemplatingService.getInstance();
TemplateType tt = this.getTemplateType();
if (tt.getOutputMethods().size() != 0)
{
OutputUtil.generate(ts.parseXML(this.content),
tt,
this.fileName,
this.getContainerNodeRef(),
this.fileFolderService,
this.contentService,
this.nodeService);
}
OutputUtil.generate(this.createdNode,
ts.parseXML(this.content),
tt,
this.fileName,
this.getContainerNodeRef(),
this.fileFolderService,
this.contentService,
this.nodeService);
}
// return the default outcome