/**
  * @param node The node which still contains the old group.
  * @param newGroup The new group to replace the one currently stored in <b>node </b>.
  */
 public UndoableModifyGroup(
     GroupSelector gs, GroupTreeNode groupsRoot, GroupTreeNode node, AbstractGroup newGroup) {
   m_groupSelector = gs;
   m_oldGroupBackup = node.getGroup().deepCopy();
   m_newGroupBackup = newGroup.deepCopy();
   m_pathToNode = node.getIndexedPath();
   m_groupsRootHandle = groupsRoot;
 }
 public static void startManagers() {
   AbstractGroup.startManagers();
   try {
     if (gerenciadornuvem0 == null)
       gerenciadornuvem0 =
           (Gerenciadornuvem0Interface) Naming.lookup("rmi://0:1099/gerenciadornuvem0");
     if (gerenciadornuvem1 == null)
       gerenciadornuvem1 =
           (Gerenciadornuvem1Interface) Naming.lookup("rmi://1:1099/gerenciadornuvem1");
   } catch (RemoteException e) {
     e.printStackTrace();
   } catch (NotBoundException e) {
     e.printStackTrace();
   } catch (MalformedURLException e) {
     e.printStackTrace();
   }
 }
Exemple #3
0
 /**
  * Inserts a specific repetition of AL1 (Patient Allergy Information)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertAL1(AL1 structure, int rep) throws HL7Exception {
   super.insertRepetition("AL1", structure, rep);
 }
Exemple #4
0
 /**
  * Inserts a specific repetition of INSURANCE (a Group object)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertINSURANCE(OMP_O09_INSURANCE structure, int rep) throws HL7Exception {
   super.insertRepetition("INSURANCE", structure, rep);
 }
Exemple #5
0
 /**
  * Inserts a specific repetition of NTE (Notes and Comments)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertNTE(NTE structure, int rep) throws HL7Exception {
   super.insertRepetition("NTE", structure, rep);
 }
Exemple #6
0
 /**
  * Inserts a specific repetition of CTI (Clinical Trial Identification)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertCTI(CTI structure, int rep) throws HL7Exception {
   super.insertRepetition("CTI", structure, rep);
 }
Exemple #7
0
 /**
  * Inserts a specific repetition of RESULT (a Group object)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertRESULT(OUL_R23_RESULT structure, int rep) throws HL7Exception {
   super.insertRepetition("RESULT", structure, rep);
 }
Exemple #8
0
 /**
  * Inserts a specific repetition of TIMING_QTY (a Group object)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertTIMING_QTY(OUL_R23_TIMING_QTY structure, int rep) throws HL7Exception {
   super.insertRepetition("TIMING_QTY", structure, rep);
 }
Exemple #9
0
 /**
  * Inserts a specific repetition of ROL (Role)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertROL(ROL structure, int rep) throws HL7Exception {
   super.insertRepetition("ROL", structure, rep);
 }
Exemple #10
0
 /**
  * Inserts a specific repetition of OBX (Observation/Result)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertOBX(OBX structure, int rep) throws HL7Exception {
   super.insertRepetition("OBX", structure, rep);
 }
 /**
  * Inserts a specific repetition of VAR (Variance)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertVAR(VAR structure, int rep) throws HL7Exception {
   super.insertRepetition("VAR", structure, rep);
 }
Exemple #12
0
  /**
   * Recursive worker method for the populateGroupsTable methods.
   *
   * @param cursor The current GroupTreeNode in the GroupsTree
   * @param parentID The integer ID associated with the cursors's parent node
   * @param currentID The integer value to associate with the cursor
   * @param out The output (PrintStream or Connection) object to which the DML should be written.
   * @param database_id Id of jabref database to which the groups/entries are part of
   */
  private int populateGroupsTable(
      GroupTreeNode cursor, int parentID, int currentID, Object out, int database_id)
      throws SQLException {

    AbstractGroup group = cursor.getGroup();
    String searchField = null;
    String searchExpr = null;
    String caseSens = null;
    String reg_exp = null;
    GroupHierarchyType hierContext = group.getHierarchicalContext();
    if (group instanceof KeywordGroup) {
      searchField = ((KeywordGroup) group).getSearchField();
      searchExpr = ((KeywordGroup) group).getSearchExpression();
      caseSens = ((KeywordGroup) group).isCaseSensitive() ? "1" : "0";
      reg_exp = ((KeywordGroup) group).isRegExp() ? "1" : "0";
    } else if (group instanceof SearchGroup) {
      searchExpr = ((SearchGroup) group).getSearchExpression();
      caseSens = ((SearchGroup) group).isCaseSensitive() ? "1" : "0";
      reg_exp = ((SearchGroup) group).isRegExp() ? "1" : "0";
    }
    // Protect all quotes in the group descriptions:
    if (searchField != null) {
      searchField = StringUtil.quote(searchField, "'", '\\');
    }
    if (searchExpr != null) {
      searchExpr = StringUtil.quote(searchExpr, "'", '\\');
    }

    SQLUtil.processQuery(
        out,
        "INSERT INTO groups (label, parent_id, group_types_id, search_field, "
            + "search_expression, case_sensitive, reg_exp, hierarchical_context, database_id) "
            + "VALUES ('"
            + group.getName()
            + "', "
            + parentID
            + ", (SELECT group_types_id FROM group_types where label='"
            + group.getTypeId()
            + "')"
            + ", "
            + (searchField != null ? '\'' + searchField + '\'' : "NULL")
            + ", "
            + (searchExpr != null ? '\'' + searchExpr + '\'' : "NULL")
            + ", "
            + (caseSens != null ? '\'' + caseSens + '\'' : "NULL")
            + ", "
            + (reg_exp != null ? '\'' + reg_exp + '\'' : "NULL")
            + ", "
            + hierContext.ordinal()
            + ", '"
            + database_id
            + "');");
    // recurse on child nodes (depth-first traversal)
    Object response =
        SQLUtil.processQueryWithResults(
            out,
            "SELECT groups_id FROM groups WHERE label='"
                + cursor.getGroup().getName()
                + "' AND database_id='"
                + database_id
                + "' AND parent_id='"
                + parentID
                + "';");
    // setting values to ID and myID to be used in case of textual SQL
    // export
    int myID = currentID;
    if (response instanceof Statement) {
      ResultSet rs = ((Statement) response).getResultSet();
      rs.next();
      myID = rs.getInt("groups_id");
    }
    for (Enumeration<GroupTreeNode> e = cursor.children(); e.hasMoreElements(); ) {
      ++currentID;
      currentID = populateGroupsTable(e.nextElement(), myID, currentID, out, database_id);
    }
    return currentID;
  }
 /**
  * Inserts a specific repetition of RDT (Table Row Data)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertRDT(RDT structure, int rep) throws HL7Exception {
   super.insertRepetition("RDT", structure, rep);
 }
 public void redo() {
   super.redo();
   m_groupsRootHandle.getDescendant(m_pathToNode).setGroup(m_newGroupBackup.deepCopy());
   m_groupSelector.revalidateGroups();
 }
 /**
  * Inserts a specific repetition of TCC (Test Code Configuration)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertTCC(TCC structure, int rep) throws HL7Exception {
   super.insertRepetition("TCC", structure, rep);
 }
Exemple #16
0
 /**
  * Inserts a specific repetition of ORDER (a Group object)
  *
  * @see AbstractGroup#insertRepetition(Structure, int)
  */
 public void insertORDER(OUL_R23_ORDER structure, int rep) throws HL7Exception {
   super.insertRepetition("ORDER", structure, rep);
 }