use of com.centurylink.mdw.model.value.user.UserActionVO.Action in project mdw-designer by CenturyLinkCloud.
the class DesignerDataAccess method saveRuleSet.
public Long saveRuleSet(RuleSetVO ruleset) throws DataAccessException {
Long id = ruleset.getId();
Action action = id <= 0 ? Action.Create : Action.Change;
if (id <= 0)
id = persister.createRuleSet(ruleset);
else
persister.updateRuleSet(ruleset);
auditLog(action, Entity.RuleSet, id, ruleset.getDescription());
return id;
}
use of com.centurylink.mdw.model.value.user.UserActionVO.Action in project mdw-designer by CenturyLinkCloud.
the class DesignerDataAccess method savePackage.
public Long savePackage(PackageVO pPackageVO, PersistType persistType) throws DataAccessException {
Long id = persister.persistPackage(pPackageVO, persistType);
Action action = pPackageVO.getVersion() == 0 ? Action.Create : Action.Change;
auditLog(action, Entity.Package, id, pPackageVO.getLabel());
return id;
}
use of com.centurylink.mdw.model.value.user.UserActionVO.Action in project mdw-designer by CenturyLinkCloud.
the class DesignerDataAccess method setAttribute.
public void setAttribute(String ownerType, Long ownerId, String attrname, String attrvalue) throws DataAccessException {
Long existingId = persister.setAttribute(ownerType, ownerId, attrname, attrvalue);
Action action = existingId == null ? Action.Create : Action.Change;
auditLog(action, Entity.Attribute, existingId == null ? Long.valueOf(0) : existingId, attrname);
}
use of com.centurylink.mdw.model.value.user.UserActionVO.Action in project mdw-designer by CenturyLinkCloud.
the class UserDataAccessRest method auditLogUserAction.
public void auditLogUserAction(final UserActionVO userAction) throws DataAccessException {
// certain actions need to be logged on the server
// TODO: this should actually be done on the server side, but currently many services don't require username
Action action = userAction.getAction();
Entity entity = userAction.getEntity();
if (action == Action.Run || action == Action.Send || action == Action.Retry || action == Action.Proceed || action == Action.Import || entity == Entity.ProcessInstance || entity == Entity.ActivityInstance || entity == Entity.VariableInstance) {
if (isOnline()) {
// run in background thread
new Thread(new Runnable() {
public void run() {
try {
ActionRequestMessage actionRequest = new ActionRequestMessage();
actionRequest.setAction("AuditLog");
actionRequest.addParameter("appName", "MDW Designer");
JSONObject msgJson = actionRequest.getJson();
msgJson.put(userAction.getJsonName(), userAction.getJson());
invokeActionService(msgJson.toString(2));
} catch (Exception ex) {
// silent
ex.printStackTrace();
}
}
}).start();
}
}
}
use of com.centurylink.mdw.model.value.user.UserActionVO.Action in project mdw-designer by CenturyLinkCloud.
the class PreferencesSection method createNoticesTable.
private void createNoticesTable() {
noticesEditor = new TableEditor(null, TableEditor.TYPE_TABLE);
noticesEditor.setLabel("Desktop Notices");
// colspecs
List<ColumnSpec> colSpecs = new ArrayList<ColumnSpec>();
ColumnSpec selectionColSpec = new ColumnSpec(PropertyEditor.TYPE_CHECKBOX, "", "selected");
selectionColSpec.width = 50;
colSpecs.add(selectionColSpec);
ColumnSpec extensionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Task Outcome", "outcome");
extensionColSpec.width = 150;
extensionColSpec.readOnly = true;
colSpecs.add(extensionColSpec);
noticesEditor.setColumnSpecs(colSpecs);
noticesEditor.setHorizontalSpan(3);
noticesEditor.setWidth(300);
noticesEditor.setModelUpdater(new TableModelUpdater() {
public Object create() {
return null;
}
@SuppressWarnings("rawtypes")
public void updateModelValue(List tableValue) {
List<String> selectedNotices = new ArrayList<String>();
for (Action outcome : UserActionVO.NOTIFIABLE_TASK_ACTIONS) {
for (Object rowObj : tableValue) {
DefaultRowImpl row = (DefaultRowImpl) rowObj;
if (outcome.toString().equals(row.getColumnValue(1))) {
if (((Boolean) row.getColumnValue(0)).booleanValue())
selectedNotices.add(outcome.toString());
else
selectedNotices.remove(outcome.toString());
}
}
}
project.setNoticeChecks(selectedNotices);
}
});
}
Aggregations