Wizard Samples

Basics

Example of UUID:

  • Using UUID -> "373bcdd0-c082-4e7b-addd-e10ef813946e";

Suggested code sample

First, you must create the web service object:

OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

Then you should log in using the method "login". You can access the "login" method from the web service object "ws" as shown below:

ws.login(user, password);

Once you are logged in with the web services, the session is kept in the web service object. Then you can use the other API methods.

At this point you can use all the Wizard methods from the "wizard" class as shown below:

ws.wizard.findByUser();

Methods

findByUser

Description:

MethodReturn valuesDescription

findByUser()

List<WizardNode>

Returns a list of nodes with a wizard.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.WizardNode;
import com.openkm.sdk4j.impl.OKMWebservices;

import java.util.List;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            List<WizardNode> list = ws.wizard.findByUser();
            for (WizardNode wizardNode : list) {
                System.out.println(wizardNode);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findAllByUser

Description:

MethodReturn valuesDescription

findAllByUser()

List<WizardNode>

Returns a list of all nodes with an assigned wizard.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.WizardNode;
import com.openkm.sdk4j.impl.OKMWebservices;

import java.util.List;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            List<WizardNode> list = ws.wizard.findAllByUser();
            for (WizardNode wizardNode : list) {
                System.out.println(wizardNode);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findByUserAndUuid

Description:

MethodReturn valuesDescription

findByUserAndUuid(String uuid)

WizardNode

Gets the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.WizardNode;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            WizardNode wizardNode = ws.wizard.findByUserAndUuid("11225723-883f-4c12-8816-650b2c82c89b");
            System.out.println(wizardNode);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

hasWizardByUserAndNode

Description:

MethodReturn valuesDescription

hasWizardByUserAndNode()

boolean

Checks if a node has a wizard.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            System.out.println("The node has a wizard: " + ws.wizard.hasWizardByUserAndNode("11225723-883f-4c12-8816-650b2c82c89b"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

deleteAll

Description:

MethodReturn valuesDescription

deleteAll()

void

Removes all wizards for the user.

Only wizards assigned to the user session will be removed.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.deleteAll();
            System.out.println("Delete all");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

postponeNode

Description:

MethodReturn valuesDescription

postponeNode(String uuid, Calendar date)

void

Postpones the node with the specified UUID to the given date.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

import java.util.Calendar;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            Calendar calendar = Calendar.getInstance();
            calendar.set(Calendar.DAY_OF_MONTH, 15);
            ws.wizard.postponeNode("cd4f69ed-e517-408b-b7eb-95cfe371ecba", calendar);
            System.out.println("postponeNode");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

cancelPostponeNode

Description:

MethodReturn valuesDescription

cancelPostponeNode(String uuid)

void

Cancels the postponement of the node with the specified UUID.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.cancelPostponedNode("cd4f69ed-e517-408b-b7eb-95cfe371ecba");
            System.out.println("cancelPostponedNode");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

deleteByNode

Description:

MethodReturn valuesDescription

deleteByNode(String uuid)

void

Deletes the wizard node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.deleteByNode("cd4f69ed-e517-408b-b7eb-95cfe371ecba");
            System.out.println("deleteByNode");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addDigitalSignature

Description:

MethodReturn valuesDescription

addDigitalSignature()

void

Adds a digital signature to the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.addDigitalSignature("055b5206-35d0-4351-ba92-c304bbba7ddf");
            System.out.println("addDigitalSignature");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeDigitalSignature

Description:

MethodReturn valuesDescription

removeDigitalSignature

void

Removes a digital signature from the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.removeDigitalSignature("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("removeDigitalSignature");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addShowWizardCategories

Description:

MethodReturn valuesDescription

addShowWizardCategories

void

Adds show wizard categories to the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.removeDigitalSignature("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("removeDigitalSignature");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeShowWizardCategories

Description:

MethodReturn valuesDescription

removeShowWizardCategories

void

Removes show wizard categories from the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.removeShowWizardCategories("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("removeShowWizardCategories");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addShowWizardKeywords

Description:

MethodReturn valuesDescription

addShowWizardKeywords

void

Adds show wizard keywords to the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.addShowWizardKeywords("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("addShowWizardKeywords");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeShowWizardKeywords

Description:

MethodReturn valuesDescription

removeShowWizardKeywords

void

Removes show wizard keywords from the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.removeShowWizardKeywords("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("removeShowWizardKeywords");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addShowWizardOCRDataCapture

Description:

MethodReturn valuesDescription

addShowWizardOCRDataCapture

void

Adds show wizard OCR data capture to the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.addShowWizardOCRDataCapture("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("addShowWizardOCRDataCapture");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeShowWizardOCRDataCapture

Description:

MethodReturn valuesDescription

removeShowWizardOCRDataCapture

void

Removes show wizard OCR data capture from the wizard of a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.removeShowWizardOCRDataCapture("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("removeShowWizardOCRDataCapture");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addGroup

Description:

MethodReturn valuesDescription

addGroup(String uuid, String group)

void

Adds a metadata group to the wizard.

The parameter uuid is the unique node identifier.

The parameter group is the group name.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.addGroup("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae", "okg:tpl");
            System.out.println("addGroup");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeGroup

Description:

MethodReturn valuesDescription

removeGroup(String uuid, String group)

void

Removes a metadata group from the wizard.

The parameter uuid is the unique node identifier.

The parameter group is the group name.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.removeGroup("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae", "okg:tpl");
            System.out.println("removeGroup");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addWorkflow

Description:

MethodReturn valuesDescription

addWorkflow(String uuid, String workflow)

void

Adds a workflow to the wizard.

The parameter uuid is the unique node identifier.

The parameter workflow is the workflow name.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.addWorkflow("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae", "purchase");
            System.out.println("addGroup");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeWorkflow

Description:

MethodReturn valuesDescription

removeWorkflow(String uuid, String workflow)

void

Removes a workflow from the wizard.

The parameter uuid is the unique node identifier.

The parameter workflow is the workflow name.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.removeWorkflow("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae", "purchase");
            System.out.println("addGroup");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

setAutostart

Description:

MethodReturn valuesDescription

setAutostart

void

Sets auto start for the wizard.

Autostart should always be set as the last wizard option.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.impl.OKMWebservices;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.wizard.setAutostart("02add6bf-e5ac-4f4a-8f3f-922958f5b6ae");
            System.out.println("setAutostart");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}