@Override
  public String getConfigFormSnippet(
      ConnectorManager connectorManager,
      String connectorType,
      String connectorName,
      Locale locale) {
    Element xml;

    Map<String, String> paramsMap = new HashMap<String, String>();
    paramsMap.put(ServletUtil.QUERY_PARAM_LANG, locale.getLanguage());

    if (connectorName == null) {
      // New connector
      paramsMap.put(ServletUtil.XMLTAG_CONNECTOR_TYPE, connectorType);
      xml = ConnectorManagerRequestUtils.sendGet(connectorManager, "/getConfigForm", paramsMap);
    } else {
      // Existing connector
      paramsMap.put(ServletUtil.XMLTAG_CONNECTOR_NAME, connectorName);
      xml =
          ConnectorManagerRequestUtils.sendGet(
              connectorManager, "/getConnectorConfigToEdit", paramsMap);
    }

    Element formSnippet =
        xml.element(ServletUtil.XMLTAG_CONFIGURE_RESPONSE).element(ServletUtil.XMLTAG_FORM_SNIPPET);
    CDATA cdata = (CDATA) formSnippet.node(0);
    String configFormSnippetText = cdata.getStringValue();

    return configFormSnippetText;
  }
Exemple #2
0
  /**
   * Writes the given {@link CDATA}.
   *
   * @param cdata <code>CDATA</code> to output.
   * @throws IOException DOCUMENT ME!
   */
  public void write(CDATA cdata) throws IOException {
    writeCDATA(cdata.getText());

    if (autoFlush) {
      flush();
    }
  }
Exemple #3
0
 /* 175:    */
 /* 176:    */ public void write(CDATA cdata) /* 177:    */ throws SAXException /* 178:    */ {
   /* 179:277 */ String text = cdata.getText();
   /* 180:279 */ if (this.lexicalHandler != null)
   /* 181:    */ {
     /* 182:280 */ this.lexicalHandler.startCDATA();
     /* 183:281 */ write(text);
     /* 184:282 */ this.lexicalHandler.endCDATA();
     /* 185:    */ }
   /* 186:    */ else
   /* 187:    */ {
     /* 188:284 */ write(text);
     /* 189:    */ }
   /* 190:    */ }
Exemple #4
0
 public void visit(CDATA node) {
   String text = node.getText();
   extractUsedProperties(text);
 }