Package org.atomojo.app.client

Examples of org.atomojo.app.client.Feed


      try {
        
         FeedBuilder builder = new FeedBuilder();
         Response response = layoutFeedClient.get(builder);
         if (response.getStatus().isSuccess()) {
            Feed feed = builder.getFeed();
            feed.index();
           
            Set<String> names = new TreeSet<String>();

            List<SecurityGuard.SecureRoute> copyOfRoutes = new ArrayList<SecurityGuard.SecureRoute>();
            copyOfRoutes.addAll(security.getRoutes());
            try {
               security.getRoutes().clear();
               for (Entry entry : feed.getEntriesByTerm(T_SECURITY_PROTECTED_PATH)) {
                  Term paths = entry.getTerm(T_SECURITY_PROTECTED_PATH);

                  getLogger().info("Security entry "+entry.getId());
                  String unauthorized = getTerm(entry,T_SECURITY_REDIRECT_UNAUTHORIZED);
                  Reference unauthorizedRef = unauthorized==null ? null : new Reference(unauthorized);
View Full Code Here


               getLogger().severe("Cannot get feed "+layoutTemLoc+", status="+response.getStatus().getCode());
            } else {
               getLogger().warning("No application feed to load.");
            }
         } else {
            Feed feed = builder.getFeed();
            feed.index();
            Set<String> ids = new TreeSet<String>();
            String base = T_BASE.toString();
            for (Entry entry : feed.getEntriesByTerm(T_LAYOUT)) {
               String id = entry.getId();
               ids.add(id);
               Text text = entry.getContent();
               URI location = text.getElement().getBaseURI().resolve(text.getSourceLink());
               ScriptManager.Entry info = scriptManager.get(id);
View Full Code Here

               getLogger().severe("Cannot get feed "+resourceTermLoc+", status="+response.getStatus().getCode());
            } else {
               getLogger().warning("No application feed to load.");
            }
         } else {
            Feed feed = builder.getFeed();
            feed.index();
            Set<String> ids = new TreeSet<String>();
            String base = T_BASE.toString();
            for (Entry entry : feed.getEntriesByTerm(T_RESOURCE)) {
               String id = entry.getId();
               ids.add(id);
               ResourceManager.Entry info = resourceManager.get(id);
               Term nameT = entry.getTerm(T_RESOURCE_NAME);
               Term pathT = entry.getTerm(T_RESOURCE_PATH);
View Full Code Here

               getLogger().severe("Cannot get feed "+appTermLoc+", status="+response.getStatus().getCode());
            } else {
               getLogger().warning("No application feed to load.");
            }
         } else {
            Feed feed = builder.getFeed();
            feed.index();
            Set<String> ids = new TreeSet<String>();
            List<Entry> entries = new ArrayList<Entry>();
            entries.addAll(feed.getEntriesByTerm(T_APP));
            Comparator<Entry> sorter = new Comparator<Entry>() {
               public int compare(Entry A, Entry B) {
                  Term AP = A.getTerm(T_APP_PRIORITY);
                  Term BP = B.getTerm(T_APP_PRIORITY);
                  //getLogger().info("A: "+A.getTitle()+" "+AP+" vs B: "+B.getTitle()+" "+BP);
View Full Code Here

      throws IOException
   {
      File feedFile = makeFeedReference(path);
      try {
         Document doc = loader.load(feedFile.toURI());
         Feed feed = new Feed(doc);
         feed.setUpdated(updated);
         Writer out = new OutputStreamWriter(new FileOutputStream(feedFile),"UTF-8");
         XMLWriter.writeDocument(doc, out);
         out.close();
         return true;
      } catch (XMLException ex) {
View Full Code Here

      throws IOException
   {
      File feedFile = makeFeedReference(path);
      try {
         Document doc = loader.load(feedFile.toURI());
         Feed feed = new Feed(doc);
         return feed.getTitle();
      } catch (XMLException ex) {
         throw new IOException("XML exception while getting title: "+ex.getMessage());
      }
   }
View Full Code Here

      org.atomojo.app.db.Feed feed = null;
      if (feedFile.exists()) {
        
         // exists, so we'll import it
         Document doc = loader.load(feedFile.toURI());
         Feed feedObj = new Feed(doc);
         String idS = feedObj.getId();
         if (!idS.startsWith("urn:uuid:")) {
            throw new IOException("Bad feed id: "+idS);
         }
         try {
            UUID id = UUID.fromString(idS.substring(9));
View Full Code Here

      try {
         Response response = metadataClient.get(new FeedDestination() {
            public void onFeed(Document feedDoc)
               throws XMLException
            {
               Feed feed = new Feed(feedDoc);
               feed.index();
               updateSet.clear();
               updateSet.addAll(feed.getTerms().values());
               if (log.isLoggable(Level.FINE)) {
                  for (Term t : feed.getTerms().values()) {
                     log.fine("term: "+t.getURI());
                  }
               }
            }
            public void onEntry(Document entryDoc) {
View Full Code Here

      try {
        
         FeedBuilder builder = new FeedBuilder();
         Response response = layoutFeedClient.get(builder);
         if (response.getStatus().isSuccess()) {
            Feed feed = builder.getFeed();
            feed.index();
           
            Set<String> names = new TreeSet<String>();

            List<SecurityGuard.SecureRoute> copyOfRoutes = new ArrayList<SecurityGuard.SecureRoute>();
            copyOfRoutes.addAll(security.getRoutes());
            try {
               security.getRoutes().clear();
               for (Entry entry : feed.getEntriesByTerm(T_SECURITY_PROTECTED_PATH)) {
                  Term paths = entry.getTerm(T_SECURITY_PROTECTED_PATH);

                  getLogger().info("Security entry "+entry.getId());
                  String unauthorized = getTerm(entry,T_SECURITY_REDIRECT_UNAUTHORIZED);
                  Reference unauthorizedRef = unauthorized==null ? null : new Reference(unauthorized);
View Full Code Here

               getLogger().severe("Cannot get feed "+layoutTemLoc+", status="+response.getStatus().getCode());
            } else {
               getLogger().warning("No application feed to load.");
            }
         } else {
            Feed feed = builder.getFeed();
            feed.index();
            Set<String> ids = new TreeSet<String>();
            String base = T_BASE.toString();
            for (Entry entry : feed.getEntriesByTerm(T_LAYOUT)) {
               String id = entry.getId();
               ids.add(id);
               Text text = entry.getContent();
               URI location = text.getElement().getBaseURI().resolve(text.getSourceLink());
               ScriptManager.Entry info = scriptManager.get(id);
View Full Code Here

TOP

Related Classes of org.atomojo.app.client.Feed

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.