Package com.google.feedserver.util

Examples of com.google.feedserver.util.XmlUtil


  public void setUp() throws Exception {
    fileUtilMock = EasyMock.createMock(FileUtil.class);
    FeedConfiguration feedConfig = new FeedConfiguration(FEED_ID, null, null, null, serverConfig);
    FileAdapterConfig fileAdapterConfig = new FileAdapterConfig(ROOT_DIR);
    adapter = new FileAdapter(
        new XmlUtil(), fileUtilMock, new Abdera(), feedConfig, fileAdapterConfig);
  }
View Full Code Here


  protected FileAdapterConfig fileAdapterConfig = new FileAdapterConfig();

  public FileAdapter(Abdera abdera, FeedConfiguration config) throws IllegalArgumentException,
      IntrospectionException, IllegalAccessException, InvocationTargetException, SAXException,
      IOException, ParserConfigurationException, ParseException {
    this(new XmlUtil(), new FileUtil(), abdera, config);
  }
View Full Code Here

        FeedServerUtil.getStringProperty(properties, FeedServerConfiguration.ID_KEY),
        FeedServerUtil.getStringProperty(properties, FeedServerConfiguration.ID_KEY),
        FeedServerUtil.getStringProperty(properties, FeedServerConfiguration.FEED_ADAPTER_NAME_KEY),
        serverConfiguration);
    this.properties = new HashMap<String, Object>(properties);
    this.xmlUtil = new XmlUtil();
    setAdapterConfig(adapterConfiguration);
  }
View Full Code Here

   * @throws IOException
   * @throws SAXException
   */
  public SimpleFeedInfo(String feedInfoXml) throws SAXException, IOException,
      ParserConfigurationException {
    this.entityInfoMap = new XmlUtil().convertXmlToProperties(feedInfoXml);
    this.entityInfo = new SimpleEntityInfo(entityInfoMap);
  }
View Full Code Here

   * Creates the client by creating the dependencies.
   *
   * @param service the configured Gdata service.
   */
  public TypelessFeedServerClient(GoogleService service) {
    this(service, new ContentUtil(), new XmlUtil());
  }
View Full Code Here

    // Get XML and convert to primitive Object map.
    Content content = entry.getContent();
    if (content instanceof OtherContent) {
      OtherContent otherContent = (OtherContent) content;
      log.info("Entry info " + otherContent.getXml().getBlob());
      XmlUtil xmlUtil = new XmlUtil();
      try {
        String xmlText = otherContent.getXml().getBlob();
        // TODO : This is a temporary work-around till a solution for escaping the
        // '>' by the GData client library is worked
        xmlText = xmlText.replaceAll("]]>", "]]&gt;");
        Map<String, Object> entity = xmlUtil.convertXmlToProperties(xmlText);
        if (entity == null) {
          entity = new HashMap<String, Object>();
        }
        // copy id which is the same as self and edit link
        entity.put(ContentUtil.ID, entry.getId());
View Full Code Here

      String wrapperConfig) throws IllegalArgumentException, IntrospectionException,
      IllegalAccessException, InvocationTargetException, SAXException, IOException,
      ParserConfigurationException, ParseException {
    super(target, wrapperConfig);

    xmlUtil = new XmlUtil();
    Config config = new Config();
    if (wrapperConfig.startsWith(FileSystemConfigStoreUtil.FILE_INDICATOR)) {
      wrapperConfig = loadWrapperConfig(wrapperConfig.substring(1));
    }
    xmlUtil.convertXmlToBean(wrapperConfig, config);
View Full Code Here

  protected final XmlUtil xmlUtil;

  protected AbstractManagedCollectionAdapter(Abdera abdera, FeedConfiguration config) {
    super(abdera, config);
    xmlUtil = new XmlUtil();
  }
View Full Code Here

  private String getGVizContent(ResponseContext context) throws IOException, SAXException, ParserConfigurationException {
    StringWriter writer = new StringWriter();
    context.writeTo(writer);
    String[] path = new String[] {"feed", "entry", "content", "entity", "GvizEntry"};
    Map properties = new XmlUtil().convertXmlToProperties(writer.toString());
    Object value = null;
    for (String key : path) {
      value = properties.get(key);
      if (value instanceof Map) {
        properties = (Map)value;
View Full Code Here

    if (entitFilePath == null) {
      throw new IllegalArgumentException("Missing second argument for entity file path");
    }

    String entityXml = new FileUtil().readFileContents(entitFilePath);
    Map<String, Object> entity = new XmlUtil().convertXmlToProperties(entityXml);
    String feedUrl = FeedClient.host_FLAG + feedUrlPath;
    Map<String, Object> insertedEntity =
        typelessClient.insertEntry(new URL(feedUrl), entity);
    System.out.println(insertedEntity);
  }
View Full Code Here

TOP

Related Classes of com.google.feedserver.util.XmlUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.