Skip to content

Commit

Permalink
Improve automation using plugins (#64)
Browse files Browse the repository at this point in the history
Fix #58
  • Loading branch information
gnujavasergio authored and monkiki committed Mar 29, 2018
1 parent 291b4e0 commit 4745243
Show file tree
Hide file tree
Showing 135 changed files with 7,531 additions and 1,534 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -623,8 +623,8 @@
<!-- Plugin framework -->
<dependency>
<groupId>com.google.code</groupId>
<artifactId>jspf</artifactId>
<version>1.0.1</version>
<artifactId>jspf.core</artifactId>
<version>1.0.3.1</version>
</dependency>

<!-- Apache Chemistry (CMIS) -->
Expand Down
36 changes: 31 additions & 5 deletions src/main/java/com/openkm/automation/Action.java
@@ -1,6 +1,6 @@
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2017 Paco Avila & Josep Llort
* Copyright (c) 2006-2018 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
Expand All @@ -21,13 +21,39 @@

package com.openkm.automation;

import java.util.HashMap;
import java.util.Map;

public interface Action {
import net.xeoh.plugins.base.Plugin;

public interface Action extends Plugin {
public static final String METHOD_PRE = "executePre";
public static final String METHOD_POST = "executePost";

public void executePre(HashMap<String, Object> env, Object... params);
void executePre(Map<String, Object> env, Object... params) throws Exception;

void executePost(Map<String, Object> env, Object... params) throws Exception;

boolean hasPost();

boolean hasPre();

String getName();

String getParamType00();

String getParamSrc00();

String getParamDesc00();

String getParamType01();

String getParamSrc01();

String getParamDesc01();

String getParamType02();

String getParamSrc02();

public void executePost(HashMap<String, Object> env, Object... params);
String getParamDesc02();
}
12 changes: 10 additions & 2 deletions src/main/java/com/openkm/automation/AutomationException.java
@@ -1,6 +1,6 @@
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2017 Paco Avila & Josep Llort
* Copyright (c) 2006-2018 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
Expand All @@ -21,22 +21,30 @@

package com.openkm.automation;

public class AutomationException extends Exception {
import com.openkm.core.OKMException;
import com.openkm.frontend.client.constants.service.ErrorCode;

public class AutomationException extends OKMException {
private static final long serialVersionUID = 1L;

public AutomationException() {
super();
setErrorCode(ErrorCode.CAUSE_Automation);
}

public AutomationException(String message) {
super(message);
setErrorCode(ErrorCode.CAUSE_Automation);
}

public AutomationException(String message, Throwable cause) {
super(message, cause);
setErrorCode(ErrorCode.CAUSE_Automation);
}

public AutomationException(Throwable arg0) {
super(arg0);
setErrorCode(ErrorCode.CAUSE_Automation);
}
}

0 comments on commit 4745243

Please sign in to comment.