package ru korusconsulting actions import ru korusconsulting logger Kc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package ru.korusconsulting.actions;
import ru.korusconsulting.logger.KcLogger;
import ru.korusconsulting.logger.LogLevel;
import ru.korusconsulting.taskmanager.actions.KcRootAction;
import ru.korusconsulting.utils.KcUtils;
import com.documentum.fc.client.IDfPersistentObject;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.IDfId;
import com.documentum.web.common.ArgumentList;
import com.documentum.web.formext.action.IActionPrecondition;
import com.documentum.web.formext.component.Component;
import com.documentum.web.formext.config.Context;
import com.documentum.web.formext.config.IConfigElement;
import com.documentum.web.formext.control.docbase.DocbaseObject;
public class KcActionDeleteNewDocumentPrecondition extends KcRootAction {
public String[] getRequiredParams() {
return new String[] {};
}
public boolean queryExecute(String actionName, IConfigElement config,
ArgumentList args, Context context, Component component) {
initializeArgument(actionName, config, args, context, component, null);
IDfId id = KcUtils.getClientX().getId(args.get("sysObjectId"));
if (id.isObjectId()) {
try {
IDfSysObject sysObject = (IDfSysObject)component.getDfSession().getObject(id);
if (sysObject.getPolicyName().equals("lf_init")
&& sysObject.getCurrentState() < 1) {
return true;
}
} catch (DfException e) {
KcLogger.log(LogLevel.ERROR, this, "queryExecute: ERROR! ", e);
}
}
return false;
}
}