コード例 #1
0
 private int check_systemContainerExists() {
   String systemContainer = m_subAction.system_container();
   if (ooDocument.hasSection(systemContainer)) {
     return BungeniError.SYSTEM_CONTAINER_ALREADY_EXISTS;
   } else {
     return BungeniError.SYSTEM_CONTAINER_NOT_PRESENT;
   }
 }
コード例 #2
0
 private int check_rootContainerExists() {
   String rootSectionname = CommonPropertyFunctions.getDocumentRootSection();
   if (ooDocument.hasSection(rootSectionname)) {
     return BungeniError.DOCUMENT_ROOT_EXISTS;
   } else {
     return BungeniError.DOCUMENT_ROOT_DOES_NOT_EXIST;
   }
 }
コード例 #3
0
 private int check_actionSectionExists() {
   if (m_parentAction.action_numbering_convention().equals("single")) {
     if (ooDocument.hasSection(m_parentAction.action_naming_convention())) {
       return BungeniError.SECTION_EXISTS;
     } else {
       return BungeniError.SECTION_DOES_NOT_EXIST;
     }
   } else { // if section style is not single then multiple instances of the section can be
            // created.
     return BungeniError.SECTION_DOES_NOT_EXIST;
   }
 }
コード例 #4
0
 private int check_systemContainerPositionCheck() {
   String systemContainer = m_subAction.system_container();
   if (ooDocument.hasSection(systemContainer)) {
     String currentSection = ooDocument.currentSectionName();
     if (currentSection.equals(systemContainer)) {
       return BungeniError.SYSTEM_CONTAINER_ALREADY_EXISTS;
     } else {
       return BungeniError.SYSTEM_CONTAINER_WRONG_POSITION;
     }
   } else {
     return BungeniError.SYSTEM_CONTAINER_CHECK_OK;
   }
 }
コード例 #5
0
  private String get_newSectionNameForAction(toolbarAction pAction) {
    String newSectionName = "";
    if (pAction.action_numbering_convention().equals("single")) {
      newSectionName = pAction.action_naming_convention();
    } else if (pAction.action_numbering_convention().equals("serial")) {
      String sectionPrefix = pAction.action_naming_convention();
      for (int i = 1; ; i++) {
        if (ooDocument.hasSection(sectionPrefix + i)) {
          continue;
        } else {
          newSectionName = sectionPrefix + i;
          break;
        }
      }

    } else {
      log.error(
          "get_newSectionNameForAction: invalid action naming convention: "
              + m_parentAction.action_naming_convention());
    }
    return newSectionName;
  }