Search in sources :

Example 1 with Extension

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

the class AlfrescoArtifactExporter method writeShareExtensionModule.

/**
	 * Write the Share module XML in the given conversion to the given stream. 
	 */
public void writeShareExtensionModule(OutputStream out, WorkflowDefinitionConversion conversion) throws IOException {
    Extension extension = AlfrescoConversionUtil.getExtension(conversion);
    try {
        ModuleDeployment toMarshall = new ModuleDeployment();
        toMarshall.setModule(extension.getModules().get(0).getId());
        // In case the configuration should NOT be exported as a module, wrap the configurations
        // in a "alfresco-configuration" element instead
        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) ModuleDeployment(org.activiti.workflow.simple.alfresco.model.config.ModuleDeployment) Marshaller(javax.xml.bind.Marshaller) JAXBException(javax.xml.bind.JAXBException) IOException(java.io.IOException)

Example 2 with Extension

use of org.activiti.workflow.simple.alfresco.model.config.Extension 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)

Example 3 with Extension

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

the class InitializeAlfrescoModelsConversionListener method addExtension.

protected void addExtension(WorkflowDefinitionConversion conversion, String processId) {
    // Create form-configuration
    Extension extension = new Extension();
    Module module = new Module();
    extension.addModule(module);
    module.setId(MessageFormat.format(MODULE_ID, processId));
    AlfrescoConversionUtil.storeExtension(extension, conversion);
}
Also used : FieldExtension(org.activiti.bpmn.model.FieldExtension) Extension(org.activiti.workflow.simple.alfresco.model.config.Extension) Module(org.activiti.workflow.simple.alfresco.model.config.Module)

Aggregations

Extension (org.activiti.workflow.simple.alfresco.model.config.Extension)3 IOException (java.io.IOException)2 JAXBException (javax.xml.bind.JAXBException)2 Marshaller (javax.xml.bind.Marshaller)2 FieldExtension (org.activiti.bpmn.model.FieldExtension)1 AlfrescoConfiguration (org.activiti.workflow.simple.alfresco.model.config.AlfrescoConfiguration)1 Module (org.activiti.workflow.simple.alfresco.model.config.Module)1 ModuleDeployment (org.activiti.workflow.simple.alfresco.model.config.ModuleDeployment)1