use of com.opensymphony.xwork2.Action in project atlasmap by atlasmap.
the class BaseMarshallerTest method generateActions.
private ArrayList<Action> generateActions() {
ArrayList<Action> actions = new ArrayList<Action>();
actions.add(new Camelize());
actions.add(new Capitalize());
actions.add(new Length());
actions.add(new Lowercase());
actions.add(new SeparateByDash());
actions.add(new SeparateByUnderscore());
actions.add(new Trim());
actions.add(new TrimLeft());
actions.add(new TrimRight());
actions.add(new Uppercase());
return actions;
}
use of com.opensymphony.xwork2.Action in project atlasmap by atlasmap.
the class BaseMarshallerTest method generateSeparateAtlasMapping.
protected AtlasMapping generateSeparateAtlasMapping() {
ArrayList<Action> actions = generateActions();
StringList annotations = generateAnnotations();
ModifierList modifierList = generateModifierList();
StringList parameterizedTypes = generateParameterizedTypes();
JavaField inputJavaField = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
JavaField outputJavaFieldA = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
JavaField outputJavaFieldB = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
Mapping fm = (Mapping) AtlasModelFactory.createMapping(MappingType.SEPARATE);
fm.getInputField().add(inputJavaField);
fm.getOutputField().add(outputJavaFieldA);
fm.getOutputField().add(outputJavaFieldB);
populateMapping(fm, MappingType.SEPARATE, "MapPropertyFieldAlias", ",", ",");
populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
AtlasMapping mapping = generateAtlasMapping();
mapping.getMappings().getMapping().clear();
mapping.getMappings().getMapping().add(fm);
return mapping;
}
use of com.opensymphony.xwork2.Action in project atlasmap by atlasmap.
the class BaseMarshallerTest method generateConstantMapping.
protected AtlasMapping generateConstantMapping() {
AtlasMapping mapping = generateAtlasMapping();
ConstantField inputField = new ConstantField();
ArrayList<Action> actions = new ArrayList<Action>();
actions.add(new Trim());
populateFieldComplexObject(inputField, actions, CollectionType.ARRAY, FieldStatus.SUPPORTED, FieldType.INTEGER);
populateFieldSimpleObject(inputField, 3, "docid", "/path", false, "bar");
Mapping fm = (Mapping) mapping.getMappings().getMapping().get(0);
fm.getInputField().add(inputField);
fm.getOutputField().add(inputField);
populateMapping(fm, MappingType.MAP, "MapPropertyFieldAlias", ",", ",");
populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
return mapping;
}
use of com.opensymphony.xwork2.Action in project bamboobsc by billchen198318.
the class BaseSimpleActionInfo method execute.
public void execute() {
ActionInvocation actionInvocation = ActionContext.getContext().getActionInvocation();
HttpServletRequest request = ServletActionContext.getRequest();
String action = SimpleUtils.getStr(actionInvocation.getProxy().getActionName(), "");
String namespace = SimpleUtils.getStr(actionInvocation.getProxy().getNamespace(), "");
String remoteAddr = SimpleUtils.getStr(request.getRemoteAddr(), "");
String referer = SimpleUtils.getStr(request.getHeader("referer"), "");
this.actionMethodName = actionInvocation.getProxy().getMethod();
ActionContext.getContext().getSession().put(Constants.SESS_PAGE_INFO_ACTION_ByAction, action);
ActionContext.getContext().getSession().put(Constants.SESS_PAGE_INFO_NAMESPACE_ByAction, namespace);
ActionContext.getContext().getSession().put(Constants.SESS_PAGE_INFO_RemoteAddr_ByAction, remoteAddr);
ActionContext.getContext().getSession().put(Constants.SESS_PAGE_INFO_Referer_ByAction, referer);
this.pageInfoActionName = action;
this.pageInfoNamespace = namespace;
this.pageInfoRemoteAddr = remoteAddr;
this.pageInfoReferer = referer;
}
use of com.opensymphony.xwork2.Action in project bamboobsc by billchen198318.
the class ActionInfoSupportInterceptor method intercept.
@Override
public String intercept(ActionInvocation actionInvocation) throws Exception {
/*
ActionInvocation ai=(ActionInvocation)ActionContext.getContext().get(ActionContext.ACTION_INVOCATION);
String action=ai.getProxy().getActionName();
String namespace=ai.getProxy().getNamespace();
*/
HttpServletRequest request = ServletActionContext.getRequest();
ActionContext context = actionInvocation.getInvocationContext();
String action = actionInvocation.getProxy().getActionName();
String namespace = actionInvocation.getProxy().getNamespace();
String remoteAddr = request.getRemoteAddr();
String referer = request.getHeader("referer");
context.getSession().put(Constants.SESS_PAGE_INFO_ACTION_ByInterceptor, action);
context.getSession().put(Constants.SESS_PAGE_INFO_NAMESPACE_ByInterceptor, namespace);
context.getSession().put(Constants.SESS_PAGE_INFO_RemoteAddr_ByInterceptor, remoteAddr);
context.getSession().put(Constants.SESS_PAGE_INFO_Referer_ByInterceptor, referer);
return actionInvocation.invoke();
}
Aggregations