Export the action node from config.

@param actions The allowed actions (must not be <code>null</code>).
@return The actions node.
@throws LionEngineException If unable to write node.
772592
public static Xml exports(Collection<ActionRef> actions)
    {
        Check.notNull(actions);

        final Xml node = new Xml(NODE_ACTIONS);

        for (final ActionRef action : actions)
        {
            final Xml nodeAction = node.createChild(NODE_ACTION);
            nodeAction.writeString(ATT_PATH, action.getPath());
            if (action.hasCancel())
            {
                nodeAction.writeBoolean(ATT_CANCEL, true);
            }
            for (final ActionRef ref : action.getRefs())
            {
                exports(nodeAction, ref);
            }
        }

        return node;
    }
108474
function _createAction(action) {
  if (_isString(action)) {
    action = {
      destination: action,
    }
  }
  if (_isObject(action)) {
    action = (function() {
      const openNewTab = action.openNewTab
      const destination = action.destination
      return function() {
        if (openNewTab) {
          window.open(destination, '_blank')
        } else {
          window.location.href = destination
        }
      }
    })()
  }

  return action
}
588085
private void writeActions(List<Action> actions)
            throws JsonGenerationException, IOException {
        List<String> actionStrings = new ArrayList<String>();

        for (Action action : actions) {
            actionStrings.add(action.getActionName());
        }
        writeJsonArray(JsonDocumentFields.ACTION, actionStrings);
    }
863895
public void prependActionsToActionStateExecutionList(final Flow flow, final ActionState actionStateId, final EvaluateAction... actions) {
        addActionsToActionStateExecutionListAt(flow, actionStateId.getId(), 0, actions);
    }
951185
public void setAction(String action) throws ApplicationException {
	action = action.toLowerCase().trim();
	if (action.equals("get")) this.action = GET;
	else if (action.equals("put")) this.action = PUT;

	else if (action.equals("cache")) this.action = CACHE;
	else if (action.equals("clientcache")) this.action = CACHE_CLIENT;
	else if (action.equals("servercache")) this.action = CACHE_SERVER;
	else if (action.equals("flush")) this.action = FLUSH;
	else if (action.equals("optimal")) this.action = CACHE;

	else if (action.equals("client-cache")) this.action = CACHE_CLIENT;
	else if (action.equals("client_cache")) this.action = CACHE_CLIENT;

	else if (action.equals("server-cache")) this.action = CACHE_SERVER;
	else if (action.equals("server_cache")) this.action = CACHE_SERVER;

	else if (action.equals("content")) this.action = CONTENT;
	else if (action.equals("content_cache")) this.action = CONTENT;
	else if (action.equals("contentcache")) this.action = CONTENT;
	else if (action.equals("content-cache")) this.action = CONTENT;
	else throw new ApplicationException("invalid value for attribute action for tag cache [" + action + "], "
		+ "valid actions are [get,put,cache, clientcache, servercache, flush, optimal, contentcache]");

	// get: get an object from the cache.
	// put: Add an object to the cache.

    }
508112
@Override
    public void exportAction(boolean syncAction,
            long uso, long seqNo, int partitionId, String streamName)
    {
        if (EXPORT_LOG.isDebugEnabled()) {
            EXPORT_LOG.debug("exportAction on partition " + partitionId + " syncAction: " + syncAction + ", uso: " +
                    uso + ", seqNo: " + seqNo + ", streamName: " + streamName);
        }
        //Clear is destructive, do it before the native call
        m_nextDeserializer.clear();
        long retval = nativeExportAction(pointer,
                                         syncAction, uso, seqNo, getStringBytes(streamName));
        if (retval < 0) {
            LOG.info("exportAction failed.  syncAction: " + syncAction + ", uso: " +
                    uso + ", seqNo: " + seqNo + ", partitionId: " + partitionId +
                    ", streamName: " + streamName);
        }
    }
1136669
public void setAction(String action) throws ApplicationException {
	action = action.toLowerCase().trim();
	if (action.equals("getall")) this.action = ACTION_GET_ALL;
	else if (action.equals("get")) this.action = ACTION_GET;
	else if (action.equals("set")) this.action = ACTION_SET;
	else if (action.equals("delete")) this.action = ACTION_DELETE;
	else throw new ApplicationException("attribute action of the tag registry has an invalid value [" + action + "], valid values are [getAll, get, set, delete]");
    }
630102
public void act(ActionExec action, List<ActionExec> feedback) {
        if (!isRunning())
            return;
        if (this.getSimulation() == null)
            return;

        boolean result = false;

        Structure actionStructure = action.getActionTerm();
        String actionID = actionStructure.getFunctor();

        try {
            if (this.actions.containsKey(actionID)) {

                Constructor<? extends JasonShanksAgentAction> c = this.actions
                        .get(actionID).getConstructor(
                                new Class[] { String.class, Steppable.class });

                JasonShanksAgentAction shanksAction = c.newInstance(
                        this.getID(), this, this.getLogger());

                result = shanksAction.executeAction(this.getSimulation(), this,
                        actionStructure.getTerms());
            } else {
                throw new UnknownShanksAgentActionException(actionID,
                        this.getID());
            }

        } catch (UnknownShanksAgentActionException e) {
            logger.severe("Action was not executed -> " + e.getMessage());
            e.printStackTrace();
        } catch (InstantiationException e) {
            logger.severe("InstantiationException" + e.getMessage());
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            logger.severe("IllegalAccessException" + e.getMessage());
            e.printStackTrace();
        } catch (SecurityException e) {
            logger.severe("SecurityException" + e.getMessage());
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            logger.severe("NoSuchMethodException" + e.getMessage());
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            logger.severe("IllegalArgumentException" + e.getMessage());
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            logger.severe("InvocationTargetException" + e.getMessage());
            e.printStackTrace();
        }

        action.setResult(result);
        this.getTS().getC().addFeedbackAction(action);
    }
475655
public CmdLineAction onOption(BiConsumer<@NonNull String, @NonNull String> action) {
		OptionCmdLineAction optionAction = new OptionCmdLineAction(action);

		this.optionActions.add(optionAction);
		return optionAction;
	}
1215940
private static List<ProxyAction> createProxyActions(final Slice<Action> actionBeans) {
        final List<ProxyAction> proxyActions = new ArrayList<>();
        for (final Action action : actionBeans) {
            final ProxyAction proxyAction = new ProxyAction();
            final String dsNameVersion = action.getDistributionSet().getName() + ":"
                    + action.getDistributionSet().getVersion();
            proxyAction.setActive(action.isActive());
            proxyAction.setIsActiveDecoration(buildIsActiveDecoration(action));
            proxyAction.setDsNameVersion(dsNameVersion);
            proxyAction.setAction(action);
            proxyAction.setId(action.getId());
            proxyAction.setLastModifiedAt(action.getLastModifiedAt());
            proxyAction.setRolloutName(action.getRollout() != null ? action.getRollout().getName() : "");
            proxyAction.setStatus(action.getStatus());
            proxyAction.setMaintenanceWindow(
                    action.hasMaintenanceSchedule() ? buildMaintenanceWindowDisplayText(action) : "");

            proxyActions.add(proxyAction);
        }
        return proxyActions;
    }
100575
public void setAction(final Action action) {
		MenuItemModel model = getOrCreateComponentModel();
		model.action = action;
		model.url = null;
	}
501700
private void buttonExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExportActionPerformed
    final File toSave = DialogProviderManager.getInstance().getDialogProvider().msgSaveFileDialog(null, "note-editor", UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.saveTitle"), null, true, TEXT_FILE_FILTER, "Save"); //NOI18N
    if (toSave != null) {
      try {
        final String text = getText();
        FileUtils.writeStringToFile(toSave, text, "UTF-8"); //NOI18N
      } catch (Exception ex) {
        LOGGER.error("Error during text file saving", ex); //NOI18N
        DialogProviderManager.getInstance().getDialogProvider().msgError(Main.getApplicationFrame(), UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.msgError"));
      }
    }

  }
771961
public Collection<? extends Action> getProjectActions() {
        // delegate to getJobAction (singular) for backward compatible behavior
        Action a = getProjectAction();
        if (a==null)    return Collections.emptyList();
        return Collections.singletonList(a);
    }
815842
def export_action_form_factory(formats):
    
    class _ExportActionForm(ActionForm):
        """
        Action form with export format ChoiceField.
        """
        file_format = forms.ChoiceField(
            label=_('Format'), choices=formats, required=False)
    _ExportActionForm.__name__ = str('ExportActionForm')

    return _ExportActionForm
763011
private static String getActionString(int action) {

        switch (action) {

            case Constraint.RESTRICT :
                return Tokens.T_RESTRICT;

            case Constraint.CASCADE :
                return Tokens.T_CASCADE;

            case Constraint.SET_DEFAULT :
                return Tokens.T_SET + ' ' + Tokens.T_DEFAULT;

            case Constraint.SET_NULL :
                return Tokens.T_SET + ' ' + Tokens.T_NULL;

            default :
                return Tokens.T_NO + ' ' + Tokens.T_ACTION;
        }
    }
1212866
@Exported(name="actions")
    @Nonnull
    public final List<? extends Action> getAllActions() {
        List<Action> _actions = getActions();
        boolean adding = false;
        for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass(), Action.class)) {
            Collection<? extends Action> additions = createFor(taf);
            if (!additions.isEmpty()) {
                if (!adding) { // need to make a copy
                    adding = true;
                    _actions = new ArrayList<>(_actions);
                }
                _actions.addAll(additions);
            }
        }
        return Collections.unmodifiableList(_actions);
    }
1092583
public static Xml exports(ActionConfig config)
    {
        Check.notNull(config);

        final Xml nodeAction = new Xml(NODE_ACTION);
        nodeAction.writeString(ATT_NAME, config.getName());
        nodeAction.writeString(ATT_DESCRIPTION, config.getDescription());
        nodeAction.writeInteger(ATT_X, config.getX());
        nodeAction.writeInteger(ATT_Y, config.getY());
        nodeAction.writeInteger(ATT_WIDTH, config.getWidth());
        nodeAction.writeInteger(ATT_HEIGHT, config.getHeight());

        return nodeAction;
    }