Exemplo n.º 1
0
  public static Document getField(String fieldName) {
    final VFSPathToken token = new VFSPathToken(fieldName + ".xml");
    if (SIS.get().getVFS().exists(FIELDS_DIR.child(token))) {
      try {
        return getInputStreamFile(SIS.get().getVFS().getInputStream(FIELDS_DIR.child(token)));
      } catch (IOException e) {
        Debug.println("Field {0} reported existence, but could not be loaded:\n{1}", fieldName, e);
      }
    }

    return getInputStreamFile(DocumentLoader.class.getResourceAsStream(fieldName + ".xml"));
  }
Exemplo n.º 2
0
  public static Document getView() {
    final VFSPathToken token = new VFSPathToken("views.xml");
    if (SIS.get().getVFS().exists(FIELDS_DIR.child(token))) {
      try {
        return SIS.get().getVFS().getMutableDocument(FIELDS_DIR.child(token));
      } catch (IOException e) {
        Debug.println("View reported existence, but could not be loaded:\n{0}", e);
      }
    }

    return BaseDocumentUtils.impl.getInputStreamFile(
        DocumentLoader.class.getResourceAsStream("views.xml"));
  }