@Override public void invokeWorkflow() throws Exception { throw new WorkflowException("unsupported operation"); } }
private void copyFolderTypes(final Node copiedDoc, final Map<String, Set<String>> prototypes) throws RepositoryException { // check if we have all subject folder types; Document rootDocument = new Document(rootSubject); Workflow internalWorkflow; try { internalWorkflow = workflowContext.getWorkflow("internal", rootDocument); if (!(internalWorkflow instanceof FolderWorkflow)) { throw new WorkflowException( "Target folder does not have a folder workflow in the category 'internal'."); } final Map<String, Set<String>> copyPrototypes = (Map<String, Set<String>>) internalWorkflow.hints().get("prototypes"); if (copyPrototypes != null && copyPrototypes.size() > 0) { // got some stuff...check if equal: final Set<String> protoKeys = prototypes.keySet(); final Set<String> copyKeys = copyPrototypes.keySet(); // check if we have a difference and overwrite if (copyKeys.size() != protoKeys.size() || !copyKeys.containsAll(protoKeys)) { final String[] newValues = copyKeys.toArray(new String[copyKeys.size()]); copiedDoc.setProperty("hippostd:foldertype", newValues); } } } catch (WorkflowException e) { log.warn(e.getClass().getName() + ": " + e.getMessage(), e); } catch (RemoteException e) { log.error(e.getClass().getName() + ": " + e.getMessage(), e); } } }
@Override protected String execute(Workflow wf) { try { EditmodelWorkflow workflow = (EditmodelWorkflow) wf; if (workflow != null) { workflow.commit(); } } catch (WorkflowException ex) { return ex.getClass().getName() + ": " + ex.getMessage(); } catch (RemoteException ex) { return ex.getClass().getName() + ": " + ex.getMessage(); } catch (RepositoryException ex) { return ex.getClass().getName() + ": " + ex.getMessage(); } return null; } });
@Override public void setNode(final Node node) throws RepositoryException { super.setNode(node); try { // instantiate SCXMLWorkflowExecutor using default SCXMLWorkflowContext and DocumentHandle implementing SCXMLWorkflowData workflowExecutor = new SCXMLWorkflowExecutor<>(new SCXMLWorkflowContext(getScxmlId(), getWorkflowContext()), createDocumentHandle(node)); } catch (WorkflowException wfe) { if (wfe.getCause() != null && wfe.getCause() instanceof RepositoryException) { throw (RepositoryException)wfe.getCause(); } throw new RepositoryException(wfe); } }
@Override protected void onOk() { try { invoker.invokeWorkflow(); } catch (WorkflowException e) { log.warn("Could not execute workflow: " + e.getMessage()); error(e); } catch (Exception e) { log.error("Could not execute workflow.", e); error(e); } }
@Override public void publish(final Date publicationDate, final Date unpublicationDate) throws WorkflowException { throw new WorkflowException(UNSUPPORTED); }
log.error(ex.getClass().getName() + ": " + ex.getMessage()); } catch (RemoteException ex) { log.error(ex.getClass().getName() + ": " + ex.getMessage());
@Override public void requestPublicationDepublication(final Date publicationDate, final Date unpublicationDate) throws WorkflowException, RepositoryException, RemoteException { throw new WorkflowException(UNSUPPORTED); }
@Override protected void onOk() { try { invoker.invokeWorkflow(); } catch (WorkflowSNSException e) { log.warn("Could not execute workflow due to same-name-sibling issue: " + e.getMessage()); handleExceptionTranslation(e, e.getConflictingName()); } catch (WorkflowException e) { log.warn("Could not execute workflow: " + e.getMessage()); handleExceptionTranslation(e); } catch (AccessDeniedException e) { log.warn("Access denied: " + e.getMessage()); handleExceptionTranslation(e); } catch (Exception e) { log.error("Could not execute workflow.", e); error(e); } }
protected String execute(T workflow) throws Exception { throw new WorkflowException("unsupported operation"); }
log.error(ex.getMessage(), ex); } catch (WorkflowException ex) { log.error(ex.getMessage(), ex); } catch (RemoteException ex) { log.error(ex.getMessage(), ex);
@Override public void requestPublication(final Date publicationDate, final Date unpublicationDate) throws WorkflowException { throw new WorkflowException(UNSUPPORTED); }
log.error(ex.getMessage(), ex); } catch (WorkflowException ex) { log.error(ex.getMessage(), ex); } catch (RemoteException ex) { log.error(ex.getMessage(), ex);
public Document disposeEditableInstance() throws WorkflowException, MappingException, RepositoryException, RemoteException { throw new WorkflowException("Document type does not allow for reverting changes"); }
log.error(ex.getClass().getName()+": "+ex.getMessage(), ex); } catch (RemoteException ex) { log.error(ex.getClass().getName()+": "+ex.getMessage(), ex);
public void requestPublication(Date publicationDate, Date depublicationDate) throws WorkflowException { ReviewedActionsWorkflowImpl.log.info("publication request on document "); throw new WorkflowException("unsupported"); }
private boolean saveFolder(FolderTranslation ft, javax.jcr.Session session) { if (!ft.isEditable()) { throw new UnsupportedOperationException("Translation is immutable"); } String id = ft.getId(); try { Node node = session.getNodeByIdentifier(id); WorkflowManager manager = ((HippoWorkspace) node.getSession().getWorkspace()).getWorkflowManager(); TranslationWorkflow tw = (TranslationWorkflow) manager.getWorkflow("translation", node); String namefr = ft.getNamefr(); String urlfr = ft.getUrlfr(); Document translationDoc = tw.addTranslation(language, urlfr); if (namefr != null && !urlfr.equals(namefr)) { DefaultWorkflow defaultWorkflow = (DefaultWorkflow) manager.getWorkflow("core", translationDoc); defaultWorkflow.setDisplayName(namefr); } return true; } catch (RepositoryException e) { log.error("Could not persist folder translation for " + id + " due to " + e.getMessage()); } catch (RemoteException e) { log.error( "Could not contact repository when storing folder translation for " + id + " due to " + e.getMessage()); } catch (WorkflowException e) { log.error("Workflow prevented storing translation for " + id + " due to " + e.getMessage()); } return false; }
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(); }
return ex.getClass().getName() + ": " + ex.getMessage(); } catch (ServiceException ex) { return ex.getClass().getName() + ": " + ex.getMessage();
public void publish(Date publicationDate, Date depublicationDate) throws WorkflowException { ReviewedActionsWorkflowImpl.log.info("publication on document "); throw new WorkflowException("unsupported"); }