@Override public void invokeWorkflow() throws Exception { throw new WorkflowException("unsupported operation"); } }
@Override public void publish(final Date publicationDate, final Date unpublicationDate) throws WorkflowException { throw new WorkflowException(UNSUPPORTED); }
public void delete() throws WorkflowException { ReviewedActionsWorkflowImpl.log.info("deletion on document "); if(current != null) throw new WorkflowException("cannot delete document with pending request"); if(publishedDocument != null) throw new WorkflowException("cannot delete published document"); if(draftDocument != null) throw new WorkflowException("cannot delete document being edited"); doDelete(); }
public void publish() throws WorkflowException, MappingException { ReviewedActionsWorkflowImpl.log.info("publication on document "); if(unpublishedDocument == null) { if(publishedDocument == null) { throw new WorkflowException("No unpublished version of document available for publication"); } else { throw new WorkflowException("Document has already been published"); } } if(draftDocument != null) throw new WorkflowException("cannot publish document being edited"); doPublish(); }
public void rename(String newName) throws MappingException, RemoteException, WorkflowException, RepositoryException { ReviewedActionsWorkflowImpl.log.info("rename on document "); if(current != null) throw new WorkflowException("cannot rename document with pending request"); if(publishedDocument != null || unpublishedDocument == null) throw new WorkflowException("cannot rename published document"); if(draftDocument != null) throw new WorkflowException("cannot rename document being edited"); // doDepublish(); DefaultWorkflow defaultWorkflow = (DefaultWorkflow) getWorkflowContext().getWorkflow("core", unpublishedDocument); defaultWorkflow.rename(newName); }
public void createNamespace(String prefix, String uri) throws WorkflowException, MappingException, RepositoryException { try { NamespaceRegistry nsreg = session.getWorkspace().getNamespaceRegistry(); nsreg.registerNamespace(prefix, uri); } catch (NamespaceException ex) { log.error(ex.getMessage() + " For: " + prefix + ":" + uri); throw new WorkflowException("Cannot create new namespace", ex); } }
public void requestDepublication(Date depublicationDate) throws WorkflowException { ReviewedActionsWorkflowImpl.log.info("depublication request on document "); if (current == null) { current = new PublicationRequest(PublicationRequest.SCHEDDEPUBLISH, publishedDocument, getWorkflowContext() .getUserIdentity(), depublicationDate); } else { throw new WorkflowException("publication request already pending"); } } }
public void requestDepublication() throws WorkflowException { ReviewedActionsWorkflowImpl.log.info("depublication request on document "); if (current == null) { current = new PublicationRequest(PublicationRequest.DEPUBLISH, publishedDocument, getWorkflowContext() .getUserIdentity()); } else { throw new WorkflowException("publication request already pending"); } }
protected final DocumentWorkflow getDocumentWorkflow(Node handle) throws RepositoryException, WorkflowException { Workflow wf = getWorkflowManager(handle.getSession()).getWorkflow(getWorkflowCategory(), handle); if (wf == null) { context.getLog().error("FIXME: find out what is going wrong"); throw new WorkflowException("Workflow is null"); } return (DocumentWorkflow) wf; }
public void commit() throws WorkflowException, MappingException, RepositoryException { NodeTypeState state = new NodeTypeState(); if (state.draft == null) { throw new WorkflowException("No draft available to publish"); } state.commit(); PrototypeState prototypeState = new PrototypeState(subject); prototypeState.commit(state); subject.getSession().save(); }
public void revert() throws WorkflowException, MappingException, RepositoryException { NodeTypeState state = new NodeTypeState(); if (state.draft == null) { throw new WorkflowException("No draft available to publish"); } state.revert(); PrototypeState prototypeState = new PrototypeState(subject); prototypeState.revert(); subject.getSession().save(); }
@SuppressWarnings("unchecked") protected Map<String, Boolean> getRequestActionActions(String requestIdentifier, String action) throws WorkflowException { Map<String, Map<String, Boolean>> requestActionsInfo = (Map<String, Map<String, Boolean>>)workflowExecutor.getContext().getFeedback().get("requests"); if (requestActionsInfo != null) { Map<String, Boolean> requestActions = requestActionsInfo.get(requestIdentifier); if (requestActions != null) { return requestActions; } } throw new WorkflowException("Cannot invoke workflow "+workflowExecutor.getContext().getScxmlId()+" action "+action+": request "+ requestIdentifier+" not found"); }
public void unlock() throws WorkflowException, MappingException, RepositoryException, RemoteException { if (document == null) { throw new WorkflowException("No document to unlock"); } document.setOwner(getWorkflowContext().getUserIdentity()); } }
@Override protected void doExecute(ActionExecutionContext exctx) throws ModelException, SCXMLExpressionException, WorkflowException { String condExpr = getCond(); if (!StringUtils.isBlank(condExpr) && !((Boolean)eval(condExpr))) { return; } String errorExpr = getErrorExpr(); if (StringUtils.isBlank(errorExpr)) { throw new ModelException("No error specified"); } throw new WorkflowException((String)eval(errorExpr)); } }
public void rename(String newName) throws WorkflowException, MappingException, RepositoryException, RemoteException { Document folder = new Document(getContainingFolder(subject)); Workflow workflow = getWorkflowContext().getWorkflow(getFolderWorkflowCategory(), folder); if (workflow instanceof FolderWorkflow) { ((FolderWorkflow)workflow).rename(document, newName); } else { throw new WorkflowException("cannot rename document which is not contained in a folder"); } }
public void copy(Document destination, String newName) throws MappingException, RemoteException, WorkflowException, RepositoryException { Document folder = new Document(getContainingFolder(subject)); Workflow workflow = getWorkflowContext().getWorkflow(getFolderWorkflowCategory(), destination); if(workflow instanceof EmbedWorkflow) ((EmbedWorkflow)workflow).copyTo(folder, document, newName, null); else throw new WorkflowException("cannot copy document which is not contained in a folder"); }
public void delete() throws WorkflowException, MappingException, RepositoryException, RemoteException { Workflow workflow = getWorkflowContext().getWorkflow(getFolderWorkflowCategory(), new Document(getContainingFolder(subject))); if(workflow instanceof FolderWorkflow) { ((FolderWorkflow) workflow).delete(document); } else { throw new WorkflowException("Cannot delete document that is not contained in a folder"); } }
public void archive() throws WorkflowException, MappingException, RepositoryException, RemoteException { Document folder = new Document(getContainingFolder(subject)); Workflow workflow = getWorkflowContext().getWorkflow(getFolderWorkflowCategory(), folder); if (workflow instanceof FolderWorkflow) { ((FolderWorkflow)workflow).archive(document); } else { throw new WorkflowException("cannot archive document which is not contained in a folder"); } }
@Override public Object doExecute() throws WorkflowException, RepositoryException, RemoteException { if (getVariant() == null || !getVariant().hasNode()) { throw new WorkflowException("No variant provided"); } final Session workflowSession = getWorkflowContext().getInternalWorkflowSession(); Node targetNode = getVariant().getNode(workflowSession); // ensure no pending changes which would fail the checkin workflowSession.save(); return new Document(targetNode.checkin()); } }
@Override public Object doExecute() throws WorkflowException, RepositoryException, RemoteException { if (getVariant() == null || !getVariant().hasNode() || getHistoric() == null) { throw new WorkflowException("No variant or date provided"); } Node variant = getVariant().getNode(getWorkflowContext().getInternalWorkflowSession()); final Version version = lookupVersion(variant, getHistoric()); if (version != null) { return new Document(version.getFrozenNode()); } return null; } }