Search in sources :

Example 1 with AlfrescoConfiguration

use of org.activiti.workflow.simple.alfresco.model.config.AlfrescoConfiguration in project Activiti by Activiti.

the class AlfrescoArtifactExporter method writeShareConfig.

/**
	 * Write the Share module XML in the given conversion to the given stream. 
	 */
public void writeShareConfig(OutputStream out, WorkflowDefinitionConversion conversion, boolean asExtension) throws IOException {
    Extension extension = AlfrescoConversionUtil.getExtension(conversion);
    try {
        Object toMarshall = extension;
        // in a "alfresco-configuration" element instead
        if (!asExtension) {
            toMarshall = new AlfrescoConfiguration();
            ((AlfrescoConfiguration) toMarshall).setConfigurations(extension.getModules().get(0).getConfigurations());
        }
        Marshaller marshaller = moduleJaxbContext.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
        marshaller.marshal(toMarshall, out);
    } catch (JAXBException jaxbe) {
        throw new IOException(jaxbe);
    }
}
Also used : Extension(org.activiti.workflow.simple.alfresco.model.config.Extension) Marshaller(javax.xml.bind.Marshaller) JAXBException(javax.xml.bind.JAXBException) IOException(java.io.IOException) AlfrescoConfiguration(org.activiti.workflow.simple.alfresco.model.config.AlfrescoConfiguration)

Aggregations

IOException (java.io.IOException)1 JAXBException (javax.xml.bind.JAXBException)1 Marshaller (javax.xml.bind.Marshaller)1 AlfrescoConfiguration (org.activiti.workflow.simple.alfresco.model.config.AlfrescoConfiguration)1 Extension (org.activiti.workflow.simple.alfresco.model.config.Extension)1