Package de.anomic.data.ymark

Examples of de.anomic.data.ymark.YMarkDate


            // TODO: better error handling (avoid NPE)
            bit = null;
          }
          Tables.Row bmk_row = null;
          String urlHash;
          final YMarkDate date = new YMarkDate();
          while(bit.hasNext()){     
            // urlHash = bit.next();
            bmk_row = bit.next();
            urlHash = new String(bmk_row.getPK());
           
            if(alias.contains(urlHash)) {
              buffer.setLength(0);
              buffer.append(YMarkXBELImporter.XBEL.ALIAS.startTag(true));
              buffer.append(" ref=\"b:");
              buffer.append(urlHash);
              buffer.append("\"/>");                       
              prop.put("xbel_"+count+"_elements", buffer.toString());    
              count++;   
            } else {
              alias.add(urlHash);
              // bmk_row = sb.tables.select(YMarkTables.TABLES.BOOKMARKS.tablename(bmk_user), urlHash.getBytes());
                if(bmk_row != null) {
                  buffer.setLength(0);
                 
                  buffer.append(YMarkXBELImporter.XBEL.BOOKMARK.startTag(true));
                  buffer.append(" id=\"b:");
                  buffer.append(urlHash);
                 
                  buffer.append(YMarkEntry.BOOKMARK.URL.xbel());
                  buffer.append(CharacterCoding.unicode2xml(bmk_row.get(YMarkEntry.BOOKMARK.URL.key(), YMarkEntry.BOOKMARK.URL.deflt()), true));
                 
                  buffer.append(YMarkEntry.BOOKMARK.DATE_ADDED.xbel());
                  date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_ADDED.key()));
                  buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));
                 
                  buffer.append(YMarkEntry.BOOKMARK.DATE_MODIFIED.xbel());
                  date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_MODIFIED.key()));
                  buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));
                 
                  buffer.append(YMarkEntry.BOOKMARK.DATE_VISITED.xbel());
                  date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_VISITED.key()));
                  buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));
                 
                  buffer.append(YMarkEntry.BOOKMARK.TAGS.xbel());
                  buffer.append(bmk_row.get(YMarkEntry.BOOKMARK.TAGS.key(), YMarkEntry.BOOKMARK.TAGS.deflt()));
                 
                  buffer.append(YMarkEntry.BOOKMARK.PUBLIC.xbel());
View Full Code Here


                    else if(bmk == YMarkEntry.BOOKMARK.TAGS)
                      prop.putJSON("json_"+count+"_"+bmk.key(), bmk_row.get(bmk.key(),bmk.deflt()).replaceAll(YMarkUtil.TAGS_SEPARATOR, ", "));
                    else if(bmk == YMarkEntry.BOOKMARK.FOLDERS)
                      prop.putJSON("json_"+count+"_"+bmk.key(), bmk_row.get(bmk.key(),bmk.deflt()).replaceAll(YMarkUtil.TAGS_SEPARATOR, "<br />"+FOLDER_IMG));
                    else if(bmk == YMarkEntry.BOOKMARK.DATE_ADDED || bmk == YMarkEntry.BOOKMARK.DATE_MODIFIED || bmk == YMarkEntry.BOOKMARK.DATE_VISITED)
                      prop.putJSON("json_"+count+"_"+bmk.key(), (new YMarkDate(bmk_row.get(bmk.key()))).toISO8601().replaceAll("T", "<br />"));
                    else
                        prop.putJSON("json_"+count+"_"+bmk.key(), bmk_row.get(bmk.key(),bmk.deflt()));
                }
                prop.put("json_"+count+"_comma", ",");
               
View Full Code Here

            // TODO: better error handling (avoid NPE)
            bit = null;
          }
          Tables.Row bmk_row = null;
          String urlHash;
          final YMarkDate date = new YMarkDate();
          while(bit.hasNext()){
            bmk_row = bit.next();
            urlHash = new String(bmk_row.getPK());

            if(alias.contains(urlHash)) {
              buffer.setLength(0);
              buffer.append(YMarkXBELImporter.XBEL.ALIAS.startTag(true));
              buffer.append(" ref=\"b:");
              buffer.append(urlHash);
              buffer.append("\"/>");
              prop.put("xbel_"+count+"_elements", buffer.toString());
              count++;
            } else {
              alias.add(urlHash);
                if(bmk_row != null) {
                  buffer.setLength(0);

                  buffer.append(YMarkXBELImporter.XBEL.BOOKMARK.startTag(true));
                  buffer.append(" id=\"b:");
                  buffer.append(urlHash);

                  buffer.append(YMarkEntry.BOOKMARK.URL.xbel());
                  buffer.append(CharacterCoding.unicode2xml(bmk_row.get(YMarkEntry.BOOKMARK.URL.key(), YMarkEntry.BOOKMARK.URL.deflt()), true));

                  buffer.append(YMarkEntry.BOOKMARK.DATE_ADDED.xbel());
                  date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_ADDED.key()));
                  buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));

                  buffer.append(YMarkEntry.BOOKMARK.DATE_MODIFIED.xbel());
                  date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_MODIFIED.key()));
                  buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));

                  buffer.append(YMarkEntry.BOOKMARK.DATE_VISITED.xbel());
                  date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_VISITED.key()));
                  buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));

                  buffer.append(YMarkEntry.BOOKMARK.TAGS.xbel());
                  buffer.append(CharacterCoding.unicode2xml(bmk_row.get(YMarkEntry.BOOKMARK.TAGS.key(), YMarkEntry.BOOKMARK.TAGS.deflt()),true));

                  buffer.append(YMarkEntry.BOOKMARK.PUBLIC.xbel());
View Full Code Here

                    else if(bmk == YMarkEntry.BOOKMARK.TAGS)
                      prop.putJSON("json_"+count+"_"+bmk.key(), bmk_row.get(bmk.key(),bmk.deflt()).replaceAll(YMarkUtil.TAGS_SEPARATOR, ", "));
                    else if(bmk == YMarkEntry.BOOKMARK.FOLDERS)
                      prop.putJSON("json_"+count+"_"+bmk.key(), bmk_row.get(bmk.key(),bmk.deflt()).replaceAll(YMarkUtil.TAGS_SEPARATOR, "<br />"+FOLDER_IMG));
                    else if(bmk == YMarkEntry.BOOKMARK.DATE_ADDED || bmk == YMarkEntry.BOOKMARK.DATE_MODIFIED || bmk == YMarkEntry.BOOKMARK.DATE_VISITED)
                      prop.putJSON("json_"+count+"_"+bmk.key(), (new YMarkDate(bmk_row.get(bmk.key()))).toISO8601().replaceAll("T", "<br />"));
                    else
                        prop.putJSON("json_"+count+"_"+bmk.key(), bmk_row.get(bmk.key(),bmk.deflt()));
                }

                final YMarkCrawlStart crawlstart = new YMarkCrawlStart(sb.tables, bmk_row.get(YMarkEntry.BOOKMARK.URL.key(),YMarkEntry.BOOKMARK.URL.deflt()));
View Full Code Here

TOP

Related Classes of de.anomic.data.ymark.YMarkDate

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.