public ClientWorkflowDescriptor(RemoteWorkflowDescriptor workflowDescriptor) throws MappingException { this.remote = workflowDescriptor; if(workflowDescriptor.interfaces != null) { this.interfaces = new Class[workflowDescriptor.interfaces.length]; for (int i = 0; i < interfaces.length; i++) { try { interfaces[i] = (Class<Workflow>)Class.forName(workflowDescriptor.interfaces[i]); } catch (ClassNotFoundException ex) { throw new MappingException(workflowDescriptor.interfaces[i] + " class not found", ex); } } } }
public void doPublish() throws WorkflowException, MappingException { publishedDocument = null; unpublishedDocument.setState(PublishableDocument.PUBLISHED); unpublishedDocument.setPublicationDate(new Date()); unpublishedDocument.setAvailability(new String[] { "live", "preview" }); try { VersionWorkflow versionWorkflow = (VersionWorkflow) getWorkflowContext().getWorkflow("versioning", unpublishedDocument); versionWorkflow.version(); } catch(MappingException ex) { ReviewedActionsWorkflowImpl.log.warn(ex.getClass().getName()+": "+ex.getMessage(), ex); } catch(RemoteException ex) { ReviewedActionsWorkflowImpl.log.error(ex.getClass().getName()+": "+ex.getMessage(), ex); throw new WorkflowException("Versioning of published document failed"); } catch(RepositoryException ex) { ReviewedActionsWorkflowImpl.log.error(ex.getClass().getName()+": "+ex.getMessage(), ex); throw new WorkflowException("Versioning of published document failed"); } }
versionWorkflow.version(); } catch(MappingException ex) { ReviewedActionsWorkflowImpl.log.warn(ex.getClass().getName()+": "+ex.getMessage(), ex); throw new WorkflowException("Versioning of published document failed"); } catch(RemoteException ex) { ReviewedActionsWorkflowImpl.log.warn(ex.getClass().getName()+": "+ex.getMessage(), ex); throw new WorkflowException("Versioning of published document failed"); } catch(RepositoryException ex) {
public Document copy(String relPath, String absPath, Map<String,String> arguments) throws WorkflowException, MappingException, RepositoryException, RemoteException { Node source = subject.getNode(relPath); if(!source.isNodeType(HippoNodeType.NT_DOCUMENT) && !source.isNodeType(NT_HANDLE)) { throw new MappingException("copied item is not a document"); } Node target = subject.getSession().getRootNode().getNode(absPath.substring(1, absPath.lastIndexOf('/'))); if(!target.isNodeType(HippoNodeType.NT_DOCUMENT)) { throw new MappingException("copied destination is not a document"); } return copyFrom(new Document(source), new Document(target), absPath.substring(absPath.lastIndexOf('/') + 1), arguments); } public Document copy(Document offspring, Document targetFolder, String targetName, Map<String,String> arguments)
log.error(ex.getMessage(), ex); } catch (MappingException ex) { log.error(ex.getMessage(), ex); } catch (RepositoryException ex) { log.error(ex.getMessage(), ex);
public Document move(String relPath, String absPath, Map<String,String> arguments) throws WorkflowException, MappingException, RepositoryException, RemoteException { Node source = subject.getNode(relPath); if(!source.isNodeType(HippoNodeType.NT_DOCUMENT) && !source.isNodeType(NT_HANDLE)) { throw new MappingException("copied item is not a document"); } Node target = subject.getSession().getRootNode().getNode(absPath.substring(1, absPath.lastIndexOf('/'))); if(!target.isNodeType(HippoNodeType.NT_DOCUMENT)) { throw new MappingException("copied destination is not a document"); } return moveFrom(new Document(source), new Document(target), absPath.substring(absPath.lastIndexOf('/') + 1), arguments); } public Document move(Document offspring, Document targetFolder, String targetName, Map<String,String> arguments)
public void save() throws WorkflowException, MappingException, RepositoryException { if (!subject.isNodeType(HippoNodeType.NT_TEMPLATETYPE)) { throw new MappingException("invalid node type for EditmodelWorkflow"); } subject.save(); }
public String edit() throws WorkflowException, MappingException, RepositoryException { if (!subject.isNodeType(HippoNodeType.NT_TEMPLATETYPE)) { throw new MappingException("invalid node type for EditmodelWorkflow"); } NodeTypeState state = new NodeTypeState(); if (state.draft != null) { return subject.getPath(); } try { state.checkout(); PrototypeState prototypeState = new PrototypeState(subject); prototypeState.checkout(); subject.getSession().save(); return subject.getPath(); } catch (RepositoryException ex) { subject.refresh(false); throw ex; } }
public String copy(String name) throws WorkflowException, MappingException, RepositoryException { if (!subject.isNodeType(HippoNodeType.NT_TEMPLATETYPE)) { throw new MappingException("invalid node type for EditmodelWorkflow");
protected void execute(WorkflowDescriptorModel model) throws Exception { javax.jcr.Session session = UserSession.get().getJcrSession(); session.save(); T workflow = model.getWorkflow(); if (workflow == null) { throw new MappingException("action no longer valid"); } String message = execute(workflow); if (message != null) { throw new WorkflowException(message); } // invalidate all virtual nodes & notify virtual node listeners session.refresh(false); UserSession us = UserSession.get(); us.getFacetRootsObserver().broadcastEvents(); }
throw new WorkflowException("request has already been rejected"); } else { throw new MappingException("unknown publication request");