Package org.apache.lenya.workflow

Examples of org.apache.lenya.workflow.Workflowable


    }
   
    protected boolean canNotifySubmitter() {
       
        boolean shallNotifySubmitter = false;
        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), getSourceDocument());
        Version versions[] = workflowable.getVersions();
       
        // consider the case that there was no submit transition
        if (versions.length > 0) {
            Version version = versions[versions.length - 1];
   
View Full Code Here


            getLogger().error("Can't notify submitter of document [" + authoringDocument +
                    "] because it hasn't been submitted.");
            return;
        }

        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
       
        // obtain submitted version
        Version version = versions[versions.length - 2];
       
        String userId = version.getUserId();
View Full Code Here

        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String lastModified = format.format(new Date(doc.getLastModified()));
        entry.setValue(KEY_LAST_MODIFIED, lastModified);

        if (WorkflowUtil.hasWorkflow(this.manager, getSession(), getLogger(), doc)) {
            Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager,
                    getSession(), getLogger(), doc);
            Version latestVersion = workflowable.getLatestVersion();
            String state;
            if (latestVersion != null) {
                state = latestVersion.getState();
            } else {
                Workflow workflow = WorkflowUtil.getWorkflowSchema(this.manager,
View Full Code Here

    }
   
    protected boolean canNotifySubmitter() {
       
        boolean shallNotifySubmitter = false;
        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), getSourceDocument());
        Version versions[] = workflowable.getVersions();
       
        // consider the case that there was no submit transition
        if (versions.length > 0) {
            Version version = versions[versions.length - 1];
   
View Full Code Here

            getLogger().error("Can't notify submitter of document [" + authoringDocument +
                    "] because it hasn't been submitted.");
            return;
        }

        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
       
        // obtain submitted version
        Version version = versions[versions.length - 2];
       
        String userId = version.getUserId();
View Full Code Here

            DocumentException, AccessControlException {

        User sender = getSession().getIdentity().getUser();

        String reason = getParameterAsString(REJECT_REASON);
        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
        // current version is reject, want originating submit
        Version version = versions[versions.length - 2];

        // we assume that the document has been submitted, otherwise we do
        // nothing
View Full Code Here

                        .format(new Date(getSourceDocument().getLastModified()));
                setParameter(LASTMODIFIED, lastModified);
                boolean visible = doc.getLink().getNode().isVisible();
                setParameter(VISIBLE_IN_NAVIGATION, Boolean.valueOf(visible));

                Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager,
                        getSession(), getLogger(), doc);
                resolver = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
                if (resolver.hasWorkflow(workflowable)) {
                    Workflow workflow = resolver.getWorkflowSchema(workflowable);
                    String[] variableNames = workflow.getVariableNames();
                    Version latestVersion = workflowable.getLatestVersion();
                    Boolean isLive = null;
                    if (latestVersion != null) {
                        setParameter(STATE, latestVersion.getState());
                        if (Arrays.asList(variableNames).contains(WORKFLOW_VARIABLE_ISLIVE)) {
                            isLive = Boolean.valueOf(latestVersion
View Full Code Here

        Element element = (Element) XPathAPI.selectSingleNode(parent,
                "/*[local-name() = 'entry']/*[local-name() = 'modified']");
        DocumentHelper.setSimpleElementText(element, datestr);

        // set issued date on first time publish
        Workflowable dw = WorkflowUtil.getWorkflowable(this.manager, this.getSession(), this
                .getLogger(), doc);
        Version versions[] = dw.getVersions();
        boolean wasLive = false;
        for (int i = 0; i < versions.length; i++) {
            if (versions[i].getValue("is_live")) {
                wasLive = true;
                break;
View Full Code Here

            DocumentException, AccessControlException {

        User sender = getSession().getIdentity().getUser();

        String reason = getParameterAsString(REJECT_REASON);
        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
        // current version is reject, want originating submit
        Version version = versions[versions.length - 2];

        // we assume that the document has been submitted, otherwise we do
        // nothing
View Full Code Here

    protected void sendNotification(Document authoringDocument) throws NotificationException,
            DocumentException, AccessControlException {
        User sender = getSession().getIdentity().getUser();

        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
        Version version = versions[versions.length - 2];

        // we assume that the document has been submitted, otherwise we do
        // nothing
        if (version.getEvent().equals("submit")) {
View Full Code Here

TOP

Related Classes of org.apache.lenya.workflow.Workflowable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.