Search in sources :

Example 1 with Action

use of org.powerbot.script.rt6.Action in project dhis2-core by dhis2.

the class LoginInterceptor method intercept.

@Override
public String intercept(ActionInvocation invocation) throws Exception {
    Boolean jli = (Boolean) ServletActionContext.getRequest().getSession().getAttribute(LoginInterceptor.JLI_SESSION_VARIABLE);
    if (jli != null) {
        log.debug("JLI marker is present. Running " + actions.size() + " JLI actions.");
        for (Action a : actions) {
            a.execute();
        }
        ServletActionContext.getRequest().getSession().removeAttribute(LoginInterceptor.JLI_SESSION_VARIABLE);
    }
    return invocation.invoke();
}
Also used : Action(com.opensymphony.xwork2.Action)

Example 2 with Action

use of org.powerbot.script.rt6.Action in project atlasmap by atlasmap.

the class DefaultAtlasFieldActionService method internalProcessActions.

protected Field internalProcessActions(Actions actions, Object sourceObject, FieldType targetType) throws AtlasException {
    Field processedField = new SimpleField();
    processedField.setValue(sourceObject);
    processedField.setFieldType(targetType);
    if (FieldType.COMPLEX.equals(targetType)) {
        return processedField;
    }
    Object tmpSourceObject = sourceObject;
    FieldType sourceType = (sourceObject != null ? getConversionService().fieldTypeFromClass(sourceObject.getClass()) : FieldType.NONE);
    if (actions == null || actions.getActions() == null || actions.getActions().isEmpty()) {
        if (sourceObject == null) {
            return processedField;
        }
        processedField.setValue(getConversionService().convertType(sourceObject, sourceType, targetType));
        processedField.setFieldType(targetType);
        return processedField;
    }
    FieldType currentType = sourceType;
    for (Action action : actions.getActions()) {
        ActionDetail detail = findActionDetail(action.getDisplayName(), currentType);
        if (!detail.getSourceType().equals(currentType) && !FieldType.ANY.equals(detail.getSourceType())) {
            tmpSourceObject = getConversionService().convertType(sourceObject, currentType, detail.getSourceType());
        }
        processedField.setValue(processAction(action, detail, tmpSourceObject));
        processedField.setFieldType(detail.getTargetType());
        currentType = detail.getTargetType();
    }
    return processedField;
}
Also used : Field(io.atlasmap.v2.Field) SimpleField(io.atlasmap.v2.SimpleField) AtlasFieldAction(io.atlasmap.api.AtlasFieldAction) Action(io.atlasmap.v2.Action) ActionDetail(io.atlasmap.v2.ActionDetail) SimpleField(io.atlasmap.v2.SimpleField) FieldType(io.atlasmap.v2.FieldType)

Example 3 with Action

use of org.powerbot.script.rt6.Action in project atlasmap by atlasmap.

the class DefaultAtlasFieldActionsServiceTest method testProcessActionWithActionActionDetailObject.

@Test
public void testProcessActionWithActionActionDetailObject() throws AtlasException {
    ActionDetail actionDetail = null;
    Object sourceObject = "String";
    Action action = new Trim();
    assertEquals(sourceObject, fieldActionsService.processAction(action, actionDetail, sourceObject));
    action = new GenerateUUID();
    actionDetail = new ActionDetail();
    actionDetail.setClassName("io.atlasmap.actions.StringComplexFieldActions");
    actionDetail.setSourceType(FieldType.ANY);
    actionDetail.setMethod("genareteUUID");
    assertNotNull(fieldActionsService.processAction(action, actionDetail, sourceObject));
}
Also used : Action(io.atlasmap.v2.Action) ActionDetail(io.atlasmap.v2.ActionDetail) Trim(io.atlasmap.v2.Trim) GenerateUUID(io.atlasmap.v2.GenerateUUID) Test(org.junit.Test)

Example 4 with Action

use of org.powerbot.script.rt6.Action in project weicoder by wdcode.

the class StrutsAction method getAction.

/**
 * 获得当前Action
 * @param <E> 泛型
 * @return Action
 */
@SuppressWarnings("unchecked")
public <E extends Action> E getAction() {
    // 获得值栈里的对象
    Object action = ActionContext.getContext().getValueStack().peek();
    // 判断对象是Action类型的
    if (action instanceof Action) {
        // 返回Action
        return (E) action;
    }
    // 获得Action拦截器
    ActionInvocation ai = ActionContext.getContext().getActionInvocation();
    // 如果拦截器不为空
    if (ai != null) {
        return (E) ai.getAction();
    }
    // 如果都不符合返回null
    return null;
}
Also used : Action(com.opensymphony.xwork2.Action) ActionInvocation(com.opensymphony.xwork2.ActionInvocation)

Example 5 with Action

use of org.powerbot.script.rt6.Action in project powerbot by powerbot.

the class DrawAbilities method repaint.

@Override
public void repaint(final Graphics render) {
    if (!ctx.game.loggedIn()) {
        return;
    }
    render.setFont(new Font("Arial", 0, 10));
    render.setColor(Color.green);
    for (final Action action : ctx.combatBar.actions()) {
        final Component c = action.component();
        final Point p = c.screenPoint();
        render.drawString(action.id() + " (" + action.bind() + ")", p.x, p.y);
    }
}
Also used : Action(org.powerbot.script.rt6.Action) Point(java.awt.Point) Component(org.powerbot.script.rt6.Component) Font(java.awt.Font)

Aggregations

ArrayList (java.util.ArrayList)9 Collections (java.util.Collections)9 List (java.util.List)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 DlpJob (com.google.privacy.dlp.v2.DlpJob)8 GetDlpJobRequest (com.google.privacy.dlp.v2.GetDlpJobRequest)8 InfoType (com.google.privacy.dlp.v2.InfoType)8 ProjectName (com.google.privacy.dlp.v2.ProjectName)8 ProjectSubscriptionName (com.google.pubsub.v1.ProjectSubscriptionName)8 ProjectTopicName (com.google.pubsub.v1.ProjectTopicName)8 TimeUnit (java.util.concurrent.TimeUnit)8 CommandLine (org.apache.commons.cli.CommandLine)8 CommandLineParser (org.apache.commons.cli.CommandLineParser)8 DefaultParser (org.apache.commons.cli.DefaultParser)8