Search in sources :

Example 21 with WorkflowDefinition

use of org.opencastproject.workflow.api.WorkflowDefinition in project opencast by opencast.

the class WorkflowRestService method getConfigurationPanel.

/**
 * Returns the workflow configuration panel HTML snippet for the workflow definition specified by
 *
 * @param definitionId
 * @return config panel HTML snippet
 */
@GET
@Produces(MediaType.TEXT_HTML)
@Path("configurationPanel")
@RestQuery(name = "configpanel", description = "Get the configuration panel for a specific workflow", returnDescription = "The HTML workflow configuration panel", restParameters = { @RestParameter(name = "definitionId", isRequired = false, description = "The workflow definition identifier", type = STRING) }, reponses = { @RestResponse(responseCode = SC_OK, description = "The workflow configuration panel.") })
public Response getConfigurationPanel(@QueryParam("definitionId") String definitionId) throws NotFoundException {
    WorkflowDefinition def = null;
    try {
        def = service.getWorkflowDefinitionById(definitionId);
        String out = def.getConfigurationPanel();
        return Response.ok(out).build();
    } catch (WorkflowDatabaseException e) {
        throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
    }
}
Also used : WorkflowDatabaseException(org.opencastproject.workflow.api.WorkflowDatabaseException) WebApplicationException(javax.ws.rs.WebApplicationException) WorkflowDefinition(org.opencastproject.workflow.api.WorkflowDefinition) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) RestQuery(org.opencastproject.util.doc.rest.RestQuery)

Example 22 with WorkflowDefinition

use of org.opencastproject.workflow.api.WorkflowDefinition in project opencast by opencast.

the class WorkflowDefinitionScanner method uninstall.

/**
 * {@inheritDoc}
 *
 * @see org.apache.felix.fileinstall.ArtifactInstaller#uninstall(java.io.File)
 */
public void uninstall(File artifact) throws Exception {
    // Since the artifact is gone, we can't open it to read its ID. So we look in the local map.
    String id = artifactIds.remove(artifact);
    if (id != null) {
        WorkflowDefinition def = removeWorkflowDefinition(id);
        logger.info("Uninstalling workflow definition '{}' from file '{}'", def.getId(), artifact.getName());
    }
}
Also used : WorkflowDefinition(org.opencastproject.workflow.api.WorkflowDefinition)

Aggregations

WorkflowDefinition (org.opencastproject.workflow.api.WorkflowDefinition)22 ArrayList (java.util.ArrayList)9 WorkflowDatabaseException (org.opencastproject.workflow.api.WorkflowDatabaseException)6 WorkflowInstance (org.opencastproject.workflow.api.WorkflowInstance)6 Path (javax.ws.rs.Path)5 Test (org.junit.Test)5 NotFoundException (org.opencastproject.util.NotFoundException)5 RestQuery (org.opencastproject.util.doc.rest.RestQuery)5 InputStream (java.io.InputStream)4 GET (javax.ws.rs.GET)4 JValue (com.entwinemedia.fn.data.json.JValue)3 IOException (java.io.IOException)3 Set (java.util.Set)3 Before (org.junit.Before)3 Workflows (org.opencastproject.assetmanager.util.Workflows)3 WorkflowDefinitionImpl (org.opencastproject.workflow.api.WorkflowDefinitionImpl)3 WorkflowInstanceImpl (org.opencastproject.workflow.api.WorkflowInstanceImpl)3 File (java.io.File)2 URI (java.net.URI)2 HashMap (java.util.HashMap)2