Пример #1
0
  public void perform(ActionParametersIF params, ActionResponseIF response) {

    // test params
    ActionSignature paramsType = ActionSignature.getSignature("baov");
    paramsType.validateArguments(params, this);

    ScopedIF scoped = (ScopedIF) params.get(0);
    TopicIF theme = (TopicIF) params.getTMObjectValue();
    if (theme == null) throw new ActionRuntimeException("No topic ID given to AddTheme action");

    scoped.addTheme(theme);
  }
Пример #2
0
  public void perform(ActionParametersIF params, ActionResponseIF response) {
    // test params
    ActionSignature paramsType = ActionSignature.getSignature("o t? t?");
    paramsType.validateArguments(params, this);

    OccurrenceIF occurrence = (OccurrenceIF) params.get(0);
    String value = params.getStringValue();

    if ((value == null || value.trim().length() == 0) && occurrence != null)
      delete.perform(
          params.cloneAndOverride(Collections.singletonList(Collections.singletonList(occurrence))),
          response);
    else setLocator.perform(params, response);
  }