Exemple #1
0
 public static CompositeMap downloadFile(String fileFullPath) {
   CompositeMap getItem_node = createCompositeMap("GetItem");
   CompositeMap url_node = createCompositeMap("Url");
   url_node.setText(fileFullPath);
   getItem_node.addChild(url_node);
   return getItem_node;
 }
  public void testAttribute() {

    CompositeMap schemaCm = new CompositeMap(null, SchemaConstant.SCHEMA_NAMESPACE, "schema");
    CompositeMap attributes = new CompositeMap(null, SchemaConstant.SCHEMA_NAMESPACE, "attributes");
    schemaCm.addChild(attributes);
    System.out.println("schemaCm:\n" + schemaCm.toXML());

    Element element = schema.getSchemaManager().getElement(attributes);
    assertNotNull(element);

    CompositeMap elementCm = new CompositeMap(null, SchemaConstant.SCHEMA_NAMESPACE, "element");
    CompositeMap newAttributes =
        new CompositeMap(null, SchemaConstant.SCHEMA_NAMESPACE, "attributes");
    elementCm.addChild(newAttributes);
    System.out.println("elementCm:\n" + elementCm.toXML());

    Element newElement = schema.getSchemaManager().getElement(newAttributes);
    //        assertNull(newElement);
    assertNotNull(newElement);
  }
Exemple #3
0
 private void getChilds(File file, CompositeMap parent, String fullPath) {
   if (file.isDirectory()) {
     File[] nextLevel = file.listFiles();
     for (int i = 0; i < nextLevel.length; i++) {
       getChilds(nextLevel[i], parent, fullPath);
     }
   } else if (file.getName().toLowerCase().endsWith(".bm")) {
     CompositeMap child = new CommentCompositeMap();
     String fullpath = getClassName(file, fullPath);
     child.put("name", file.getName());
     child.put("fullpath", fullpath);
     parent.addChild(child);
   }
 }
 public CompositeMap getPrimaryKeys() throws SQLException {
   CompositeMap primaryKeyArray =
       new CommentCompositeMap(BMUtil.BMPrefix, AuroraConstant.BMUri, "primary-key");
   String tableName = getTableName();
   if (tableName == null) return primaryKeyArray;
   DatabaseMetaData dbMetaData = getDBMetaData();
   ResultSet tableRet = dbMetaData.getPrimaryKeys(null, dbMetaData.getUserName(), tableName);
   while (tableRet.next()) {
     CompositeMap field =
         new CommentCompositeMap(BMUtil.BMPrefix, AuroraConstant.BMUri, "pk-field");
     field.put("name", tableRet.getString("COLUMN_NAME").toLowerCase());
     primaryKeyArray.addChild(field);
   }
   return primaryKeyArray;
 }
Exemple #5
0
 public CompositeMap beforeDispose() {
   CompositeMap records = null;
   if ((gridStyle & IGridViewer.isMulti) == 0) {
     IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
     records = (CompositeMap) selection.getFirstElement();
     if (records == null) return null;
   } else {
     Object[] elements = getCheckedElements();
     records = new CommentCompositeMap("records");
     for (int j = 0; j < elements.length; j++) {
       CompositeMap record = (CompositeMap) elements[j];
       records.addChild(record);
     }
   }
   return records;
 }