mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
fixed bug with checkboxes
partially removed need for sample instance xml - i'm doing a bunch of hacks at the moment to get around it - basically using xmlbeans to generate the sample xml, and then cleaning it up. ended up not needing to do insane things in javascript with this approach. emailed joern at chiba to see if he has suggestions for how others deal with this issue. serializing the template configuration using object serialization for now. it'll work good for the demo and we'll do something more robust/human readable post demo. this required a bunch of refactoring and springifying the TemplateService, but we're now reading back xsds and xsls from the repository which is sorta a nice thing i think. remove the preview form wizard step from create xml content type flow. tried getting rid of a temporary file in generating the xform but failed. need to find a way to get an url to a noderef that the xform can use to reference the xsd. emailed london people about that. but still did some refactoring along those lines. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3558 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -60,8 +60,6 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
private static final Log LOGGER =
|
||||
LogFactory.getLog(CreateContentWizard.class);
|
||||
|
||||
public static final org.alfresco.service.namespace.QName TT_QNAME =
|
||||
org.alfresco.service.namespace.QName.createQName(org.alfresco.service.namespace.NamespaceService.CONTENT_MODEL_1_0_URI, "tt");
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
@@ -75,45 +73,20 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
if (this.templateTypeName != null)
|
||||
{
|
||||
LOGGER.debug("generating template output for " + this.templateTypeName);
|
||||
this.nodeService.setProperty(this.createdNode, TT_QNAME, this.templateTypeName);
|
||||
this.nodeService.setProperty(this.createdNode,
|
||||
TemplatingService.TT_QNAME,
|
||||
this.templateTypeName);
|
||||
TemplatingService ts = TemplatingService.getInstance();
|
||||
TemplateType tt = this.getTemplateType();
|
||||
if (tt.getOutputMethods().size() != 0)
|
||||
{
|
||||
try {
|
||||
// get the node ref of the node that will contain the content
|
||||
NodeRef containerNodeRef = this.getContainerNodeRef();
|
||||
final String fileName = this.fileName + "-generated.html";
|
||||
FileInfo fileInfo =
|
||||
this.fileFolderService.create(containerNodeRef,
|
||||
fileName,
|
||||
ContentModel.TYPE_CONTENT);
|
||||
NodeRef fileNodeRef = fileInfo.getNodeRef();
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("Created file node for file: " +
|
||||
fileName);
|
||||
|
||||
// get a writer for the content and put the file
|
||||
ContentWriter writer = contentService.getWriter(fileNodeRef,
|
||||
ContentModel.PROP_CONTENT, true);
|
||||
// set the mimetype and encoding
|
||||
writer.setMimetype("text/html");
|
||||
writer.setEncoding("UTF-8");
|
||||
TemplateOutputMethod tom = tt.getOutputMethods().get(0);
|
||||
OutputStreamWriter out =
|
||||
new OutputStreamWriter(writer.getContentOutputStream());
|
||||
tom.generate(ts.parseXML(this.content), tt, out);
|
||||
out.close();
|
||||
this.nodeService.setProperty(fileNodeRef, TT_QNAME, this.templateTypeName);
|
||||
|
||||
LOGGER.debug("generated " + fileName + " using " + tom);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
OutputUtil.generate(ts.parseXML(this.content),
|
||||
tt,
|
||||
this.fileName,
|
||||
this.getContainerNodeRef(),
|
||||
this.fileFolderService,
|
||||
this.contentService,
|
||||
this.nodeService);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user