コード例 #1
0
ファイル: AddTheme.java プロジェクト: larsga/ontopia
  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
ファイル: SetLocator2.java プロジェクト: larsga/ontopia
  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);
  }