Examples of Abdera


Examples of org.apache.abdera.Abdera

    if (!org.apache.xml.security.Init.isInitialized())
      org.apache.xml.security.Init.init();
  }

  public XmlEncryption() {
    super(new Abdera());
  }
View Full Code Here

Examples of org.apache.abdera.Abdera

  implements Factory, Constants, ExtensionFactory {

  private final ExtensionFactoryMap factoriesMap;
 
  public FOMFactory() {
    this(new Abdera());
  }
View Full Code Here

Examples of org.apache.abdera.Abdera

  }
 
  private static String getHost(
      ServiceContext context,
      HttpServletRequest request) {
        Abdera abdera = context.getAbdera();
        String host = abdera.getConfiguration().getConfigurationOption(
          "org.apache.abdera.protocol.server.Host");
        return (host != null) ?
          host :
          request.getServerName();
    }
View Full Code Here

Examples of org.apache.abdera.Abdera

    }
   
    private static int getPort(
      ServiceContext context,
      HttpServletRequest request) {
      Abdera abdera = context.getAbdera();
        String port = abdera.getConfiguration().getConfigurationOption(
          "org.apache.abdera.protocol.server.Port");
        return (port != null) ?
          Integer.parseInt(port) :
          request.getLocalPort();
    }
View Full Code Here

Examples of org.apache.abdera.Abdera

public class FeedPagingTest extends TestCase {

  public static void testHistory() throws Exception {
   
    Abdera abdera = new Abdera();
   
    Feed feed = abdera.getFactory().newFeed();

    FeedPagingHelper.setComplete(feed, true);
    FeedPagingHelper.setArchive(feed, true);

    FeedPagingHelper.setNext(feed, "http://example.org/foo");
View Full Code Here

Examples of org.apache.abdera.Abdera

public class MediaTest extends TestCase {

  public static void testMedia() throws Exception {
   
    Abdera abdera = new Abdera();
    Factory factory = abdera.getFactory();
    Entry entry = factory.newEntry();
    MediaGroup group = entry.addExtension(GROUP);
    MediaContent content = group.addExtension(CONTENT);
    content.setUrl("http://example.org");
    content.setBitrate(123);
    content.setChannels(2);
    content.setDuration(123);
    content.setExpression(Expression.SAMPLE);
    content.setFilesize(12345);
    content.setFramerate(123);
    content.setLanguage("en");
    MediaTitle title = content.addExtension(TITLE);
    title.setType(Type.PLAIN);
    title.setText("This is a sample");
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out);
   
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    Parser parser = abdera.getParser();
    Document<Entry> doc = parser.parse(in);
    entry = doc.getRoot();
   
    group = entry.getExtension(GROUP);
    List<MediaContent> list = entry.getExtensions(CONTENT);
View Full Code Here

Examples of org.apache.abdera.Abdera

  private String certificateAlias = null;
  private PrivateKey signingKey = null;
  private X509Certificate cert = null;

  public SignedResponseFilter() {
    this.abdera = new Abdera();
    this.security = new AbderaSecurity(abdera);
  }
View Full Code Here

Examples of org.apache.abdera.Abdera

public class ThreadTest extends TestCase {

  public static void testThread() throws Exception {
   
    Abdera abdera = new Abdera();
    Factory factory = abdera.getFactory();
    Entry e1 = factory.newEntry();
    Entry e2 = factory.newEntry();
   
    e1.setId("tag:example.org,2006:first");
    e2.setId("tag:example.org,2006:second");
View Full Code Here

Examples of org.apache.abdera.Abdera

                final ClassLoader osgiClassloader = AbderaActivator.class.getClassLoader();
                Thread.currentThread().setContextClassLoader(osgiClassloader);

                try {

                    final Abdera a = new Abdera();
                    final Factory f = a.getFactory();
                    if (f instanceof FOMFactory) {
                        FOMFactory ff = (FOMFactory) f;
                        ff.registerExtension(new MediaExtensionFactory());
                        ff.registerExtension(new OpenSearchExtensionFactory());
                    }
View Full Code Here

Examples of org.apache.abdera.Abdera

public class XPathFunctionsExample {

  @SuppressWarnings("unchecked")
  public static void main(String... args) throws Exception {
   
    Abdera abdera = Abdera.getInstance();
    Feed feed = abdera.newFeed();
    feed.setBaseUri("http://example.org/");
    // add additional feed metadata
    Entry entry = feed.addEntry();
    // add additional feed metadata
    entry.addLink("alternate.xml")// relative URI
   
    XPath xpath = abdera.getXPath();
    System.out.println(xpath.valueOf("abdera:resolve(/a:feed/a:entry/a:link/@href)",feed));
   
   
    // You can add your own xpath functions.
    FOMXPath fxpath = (FOMXPath) xpath;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.