Search in sources :

Example 56 with Action

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;
}
Also used : Action(io.atlasmap.v2.Action) SeparateByUnderscore(io.atlasmap.v2.SeparateByUnderscore) Trim(io.atlasmap.v2.Trim) TrimRight(io.atlasmap.v2.TrimRight) ArrayList(java.util.ArrayList) SeparateByDash(io.atlasmap.v2.SeparateByDash) Camelize(io.atlasmap.v2.Camelize) TrimLeft(io.atlasmap.v2.TrimLeft) Length(io.atlasmap.v2.Length) Lowercase(io.atlasmap.v2.Lowercase) Uppercase(io.atlasmap.v2.Uppercase) Capitalize(io.atlasmap.v2.Capitalize)

Example 57 with Action

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;
}
Also used : Action(io.atlasmap.v2.Action) AtlasMapping(io.atlasmap.v2.AtlasMapping) StringList(io.atlasmap.v2.StringList) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 58 with Action

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;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) Action(io.atlasmap.v2.Action) ConstantField(io.atlasmap.v2.ConstantField) Trim(io.atlasmap.v2.Trim) ArrayList(java.util.ArrayList) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 59 with Action

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;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ActionInvocation(com.opensymphony.xwork2.ActionInvocation)

Example 60 with Action

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();
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ActionContext(com.opensymphony.xwork2.ActionContext) ServletActionContext(org.apache.struts2.ServletActionContext)

Aggregations

ActionSupport (com.opensymphony.xwork2.ActionSupport)61 List (java.util.List)40 Action (io.atlasmap.v2.Action)35 ArrayList (java.util.ArrayList)23 Test (org.junit.jupiter.api.Test)16 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)14 SimpleField (io.atlasmap.v2.SimpleField)13 Field (io.atlasmap.v2.Field)12 Mapping (io.atlasmap.v2.Mapping)11 ActionContext (com.opensymphony.xwork2.ActionContext)9 AtlasMapping (io.atlasmap.v2.AtlasMapping)9 Collections (java.util.Collections)9 HashMap (java.util.HashMap)9 SettableApiFuture (com.google.api.core.SettableApiFuture)8 ServiceOptions (com.google.cloud.ServiceOptions)8 DlpServiceClient (com.google.cloud.dlp.v2.DlpServiceClient)8 Subscriber (com.google.cloud.pubsub.v1.Subscriber)8 Action (com.google.privacy.dlp.v2.Action)8 BigQueryTable (com.google.privacy.dlp.v2.BigQueryTable)8 CreateDlpJobRequest (com.google.privacy.dlp.v2.CreateDlpJobRequest)8