Examples of BookmarkManager


Examples of com.gnizr.core.bookmark.BookmarkManager

  public FeedSubscriptionManager(GnizrDao gnizrDao) {
    this.feedDao = gnizrDao.getFeedSubscriptionDao();
    this.userDao = gnizrDao.getUserDao();
    this.folderDao = gnizrDao.getFolderDao();   
    bookmarkManager = new BookmarkManager(gnizrDao);
  }
View Full Code Here

Examples of com.gnizr.core.bookmark.BookmarkManager

   
    userManager = new UserManager(getGnizrDao());
    forUserManager = new ForUserManager(getGnizrDao());
    folderManager = new FolderManager(getGnizrDao());
   
    bookmarkManager = new BookmarkManager(getGnizrDao());
    bookmarkManager.addBookmarkListener(new ForUserListener(userManager,forUserManager));
    bookmarkManager.addBookmarkListener(new FolderTagListener(folderManager));
    feedManager = new FeedSubscriptionManager(getGnizrDao());
    crawlRssFeed = new CrawlRssFeed();
    crawlRssFeed.setServiceEnabled(true);
View Full Code Here

Examples of freenet.clients.http.bookmark.BookmarkManager

    throws ToadletContextClosedException, IOException {
      if(!ctx.checkFullAccess(this))
          return;

    PageMaker pageMaker = ctx.getPageMaker();
    BookmarkManager bookmarkManager = ctx.getBookmarkManager();
    String editorTitle = NodeL10n.getBase().getString("BookmarkEditorToadlet.title");
    String error = NodeL10n.getBase().getString("BookmarkEditorToadlet.error");
    PageNode page = pageMaker.getPageNode(editorTitle, ctx);
    HTMLNode pageNode = page.outer;
    HTMLNode content = page.content;
    String originalBookmark = req.getParam("bookmark");
    if(req.getParam("action").length() > 0 && originalBookmark.length() > 0) {
      String action = req.getParam("action");
      String bookmarkPath;
      try {
        bookmarkPath = URLDecoder.decode(originalBookmark, false);
      } catch(URLEncodedFormatException e) {
        pageMaker.getInfobox("infobox-error", error, content, "bookmark-url-decode-error", false).
          addChild("#", NodeL10n.getBase().getString("BookmarkEditorToadlet.urlDecodeError"));
        writeHTMLReply(ctx, 200, "OK", pageNode.generate());
        return;
      }
      Bookmark bookmark;

      if(bookmarkPath.endsWith("/"))
        bookmark = bookmarkManager.getCategoryByPath(bookmarkPath);
      else
        bookmark = bookmarkManager.getItemByPath(bookmarkPath);

      if(bookmark == null) {
        pageMaker.getInfobox("infobox-error", error, content, "bookmark-does-not-exist", false).
          addChild("#", NodeL10n.getBase().getString("BookmarkEditorToadlet.bookmarkDoesNotExist", new String[]{"bookmark"}, new String[]{bookmarkPath}));
        this.writeHTMLReply(ctx, 200, "OK", pageNode.generate());
        return;
      } else
        if("del".equals(action)) {

          String[] bm = new String[]{"bookmark"};
          String[] path = new String[]{bookmarkPath};
          String queryTitle = NodeL10n.getBase().getString("BookmarkEditorToadlet." + ((bookmark instanceof BookmarkItem) ? "deleteBookmark" : "deleteCategory"));
          HTMLNode infoBoxContent = pageMaker.getInfobox("infobox-query", queryTitle, content, "bookmark-delete", false);

          String query = NodeL10n.getBase().getString("BookmarkEditorToadlet." + ((bookmark instanceof BookmarkItem) ? "deleteBookmarkConfirm" : "deleteCategoryConfirm"), bm, path);
          infoBoxContent.addChild("p").addChild("#", query);

          HTMLNode confirmForm = ctx.addFormChild(infoBoxContent, "", "confirmDeleteForm");
          confirmForm.addChild("input", new String[]{"type", "name", "value"}, new String[]{"hidden", "bookmark", bookmarkPath});
          confirmForm.addChild("input", new String[]{"type", "name", "value"}, new String[]{"submit", "cancel", NodeL10n.getBase().getString("Toadlet.cancel")});
          confirmForm.addChild("input", new String[]{"type", "name", "value"}, new String[]{"submit", "confirmdelete", NodeL10n.getBase().getString("BookmarkEditorToadlet.confirmDelete")});

        } else if("cut".equals(action))
          cutedPath = bookmarkPath;
        else if("paste".equals(action) && cutedPath != null) {

          bookmarkManager.moveBookmark(cutedPath, bookmarkPath);
          bookmarkManager.storeBookmarks();
          cutedPath = null;

        } else if("edit".equals(action) || "addItem".equals(action) || "addCat".equals(action) || "share".equals(action)) {
          boolean isNew = "addItem".equals(action) || "addCat".equals(action);
          String header;
          if("edit".equals(action))
            header = NodeL10n.getBase().getString("BookmarkEditorToadlet.edit" + ((bookmark instanceof BookmarkItem) ? "Bookmark" : "Category") + "Title");
          else if("addItem".equals(action))
            header = NodeL10n.getBase().getString("BookmarkEditorToadlet.addNewBookmark");
          else if("share".equals(action))
            header = NodeL10n.getBase().getString("BookmarkEditorToadlet.share");
          else
            header = NodeL10n.getBase().getString("BookmarkEditorToadlet.addNewCategory");

          HTMLNode actionBoxContent = pageMaker.getInfobox("infobox-query", header, content, "bookmark-action", false);

          HTMLNode form = ctx.addFormChild(actionBoxContent, "", "editBookmarkForm");

          form.addChild("label", "for", "name", (NodeL10n.getBase().getString("BookmarkEditorToadlet.nameLabel") + ' '));
          form.addChild("input", new String[]{"type", "id", "name", "size", "value"}, new String[]{"text", "name", "name", "20", !isNew ? bookmark.getVisibleName() : ""});

          form.addChild("br");
          if(("edit".equals(action) && bookmark instanceof BookmarkItem) || "addItem".equals(action) || "share".equals(action)) {
            BookmarkItem item = isNew ? null : (BookmarkItem) bookmark;
            String key = !isNew ? item.getKey() : "";
            form.addChild("label", "for", "key", (NodeL10n.getBase().getString("BookmarkEditorToadlet.keyLabel") + ' '));
            form.addChild("input", new String[] {"type", "id", "name", "size", "value"}, new String[] {"text", "key", "key", "50", key});
            form.addChild("br");
            if("edit".equals(action) || "addItem".equals(action)) {
              form.addChild("label", "for", "descB", (NodeL10n.getBase().getString("BookmarkEditorToadlet.descLabel") + ' '));
              form.addChild("br");
              form.addChild("textarea", new String[]{"id", "name", "row", "cols"}, new String[]{"descB", "descB", "3", "70"}, (isNew ? "" : item.getDescription()));
              form.addChild("br");
              form.addChild("label", "for", "descB", (NodeL10n.getBase().getString("BookmarkEditorToadlet.explainLabel") + ' '));
              form.addChild("br");
              form.addChild("textarea", new String[]{"id", "name", "row", "cols"}, new String[]{"explain", "explain", "3", "70"}, (isNew ? "" : item.getShortDescription()));
              form.addChild("br");
            }
            form.addChild("label", "for", "hasAnActivelink", (NodeL10n.getBase().getString("BookmarkEditorToadlet.hasAnActivelinkLabel") + ' '));
            if(!isNew && item.hasAnActivelink())
              form.addChild("input", new String[]{"type", "id", "name", "checked"}, new String[]{"checkbox", "hasAnActivelink", "hasAnActivelink", String.valueOf(item.hasAnActivelink())});
            else
              form.addChild("input", new String[]{"type", "id", "name"}, new String[]{"checkbox", "hasAnActivelink", "hasAnActivelink"});
            if(core.node.getDarknetConnections().length > 0 && ("addItem".equals(action) || "share".equals(action))) {
              form.addChild("br");
              form.addChild("br");
              HTMLNode peerTable = form.addChild("table", "class", "darknet_connections");
              peerTable.addChild("th", "colspan", "2", NodeL10n.getBase().getString("QueueToadlet.recommendToFriends"));
              for(DarknetPeerNode peer : core.node.getDarknetConnections()) {
                HTMLNode peerRow = peerTable.addChild("tr", "class", "darknet_connections_normal");
                peerRow.addChild("td", "class", "peer-marker").addChild("input", new String[] { "type", "name" }, new String[] { "checkbox", "node_" + peer.hashCode() });
                peerRow.addChild("td", "class", "peer-name").addChild("#", peer.getName());
              }
              form.addChild("label", "for", "descB", (NodeL10n.getBase().getString("BookmarkEditorToadlet.publicDescLabel") + ' '));
              form.addChild("br");
              form.addChild("textarea", new String[]{"id", "name", "row", "cols"}, new String[]{"descB", "publicDescB", "3", "70"}, (isNew ? "" : item.getDescription()));
              form.addChild("br");
            }
          }

          form.addChild("input", new String[]{"type", "name", "value"}, new String[]{"hidden", "bookmark", bookmarkPath});

          form.addChild("input", new String[]{"type", "name", "value"}, new String[]{"hidden", "action", req.getParam("action")});

          form.addChild("input", new String[]{"type", "value"}, new String[]{"submit", "share".equals(action) ? NodeL10n.getBase().getString("BookmarkEditorToadlet.share") : NodeL10n.getBase().getString("BookmarkEditorToadlet.save")});
        } else if("up".equals(action))
          bookmarkManager.moveBookmarkUp(bookmarkPath, true);
        else if("down".equals(action))
          bookmarkManager.moveBookmarkDown(bookmarkPath, true);
    }

    if(cutedPath != null) {
      HTMLNode infoBoxContent =
        pageMaker.getInfobox("infobox-normal", NodeL10n.getBase().getString("BookmarkEditorToadlet.pasteTitle"), content, null, false);
View Full Code Here

Examples of freenet.clients.http.bookmark.BookmarkManager

  }

  public void handleMethodPOST(URI uri, HTTPRequest req, ToadletContext ctx)
    throws ToadletContextClosedException, IOException {
    PageMaker pageMaker = ctx.getPageMaker();
    BookmarkManager bookmarkManager = ctx.getBookmarkManager();
    PageNode page = pageMaker.getPageNode(NodeL10n.getBase().getString("BookmarkEditorToadlet.title"), ctx);
    HTMLNode pageNode = page.outer;
    HTMLNode content = page.content;

    if(req.isPartSet("AddDefaultBookmarks")) {
      bookmarkManager.reAddDefaultBookmarks();
      this.writeTemporaryRedirect(ctx, "Ok", "/");
      return;
    }

    String bookmarkPath = req.getPartAsStringFailsafe("bookmark", MAX_BOOKMARK_PATH_LENGTH);
    try {

      Bookmark bookmark;
      if(bookmarkPath.endsWith("/"))
        bookmark = bookmarkManager.getCategoryByPath(bookmarkPath);
      else
        bookmark = bookmarkManager.getItemByPath(bookmarkPath);
      if(bookmark == null && !req.isPartSet("cancelCut")) {
        pageMaker.getInfobox("infobox-error", NodeL10n.getBase().getString("BookmarkEditorToadlet.error"), content, "bookmark-error", false).
          addChild("#", NodeL10n.getBase().getString("BookmarkEditorToadlet.bookmarkDoesNotExist", new String[]{"bookmark"}, new String[]{bookmarkPath}));
        this.writeHTMLReply(ctx, 200, "OK", pageNode.generate());
        return;
      }


      String action = req.getPartAsStringFailsafe("action", MAX_ACTION_LENGTH);

      if(req.isPartSet("confirmdelete")) {
        bookmarkManager.removeBookmark(bookmarkPath);
        bookmarkManager.storeBookmarks();
        pageMaker.getInfobox("infobox-success", NodeL10n.getBase().getString("BookmarkEditorToadlet.deleteSucceededTitle"), content, "bookmark-successful-delete", false).
          addChild("p", NodeL10n.getBase().getString("BookmarkEditorToadlet.deleteSucceeded"));

      } else if(req.isPartSet("cancelCut"))
        cutedPath = null;
      else if("edit".equals(action) || "addItem".equals(action) || "addCat".equals(action)) {

        String name = "unnamed";
        if(req.isPartSet("name"))
          name = req.getPartAsStringFailsafe("name", MAX_NAME_LENGTH);

        if("edit".equals(action)) {
          bookmarkManager.renameBookmark(bookmarkPath, name);
          boolean hasAnActivelink = req.isPartSet("hasAnActivelink");
          if(bookmark instanceof BookmarkItem) {
            BookmarkItem item = (BookmarkItem) bookmark;
            item.update(new FreenetURI(req.getPartAsStringFailsafe("key", MAX_KEY_LENGTH)), hasAnActivelink, req.getPartAsStringFailsafe("descB", MAX_KEY_LENGTH), req.getPartAsStringFailsafe("explain", MAX_EXPLANATION_LENGTH));
            sendBookmarkFeeds(req, item, req.getPartAsStringFailsafe("publicDescB", MAX_KEY_LENGTH));
          }
          bookmarkManager.storeBookmarks();

          pageMaker.getInfobox("infobox-success", NodeL10n.getBase().getString("BookmarkEditorToadlet.changesSavedTitle"), content, "bookmark-error", false).
            addChild("p", NodeL10n.getBase().getString("BookmarkEditorToadlet.changesSaved"));

        } else if("addItem".equals(action) || "addCat".equals(action)) {

          Bookmark newBookmark = null;
          if("addItem".equals(action)) {
            FreenetURI key = new FreenetURI(req.getPartAsStringFailsafe("key", MAX_KEY_LENGTH));
            /* TODO:
             * <nextgens> I suggest you implement a HTTPRequest.getBoolean(String name) using Fields.stringtobool
             * <nextgens> HTTPRequest.getBoolean(String name, boolean default) even
             *
             * - values as "on", "true", "yes" should be accepted.
             */
            boolean hasAnActivelink = req.isPartSet("hasAnActivelink");
            if (name.contains("/")) {
              pageMaker.getInfobox("infobox-error", NodeL10n.getBase().getString("BookmarkEditorToadlet.invalidNameTitle"), content, "bookmark-error", false).
                addChild("#", NodeL10n.getBase().getString("BookmarkEditorToadlet.invalidName"));
            } else
              newBookmark = new BookmarkItem(key, name, req.getPartAsStringFailsafe("descB", MAX_KEY_LENGTH), req.getPartAsStringFailsafe("explain", MAX_EXPLANATION_LENGTH), hasAnActivelink, ctx.getAlertManager());
          } else
            if (name.contains("/")) {
              pageMaker.getInfobox("infobox-error", NodeL10n.getBase().getString("BookmarkEditorToadlet.invalidNameTitle"), content, "bookmark-error", false).
                addChild("#", NodeL10n.getBase().getString("BookmarkEditorToadlet.invalidName"));
            } else
              newBookmark = new BookmarkCategory(name);
         
          if (newBookmark != null) {

            bookmarkManager.addBookmark(bookmarkPath, newBookmark);
            bookmarkManager.storeBookmarks();
            if(newBookmark instanceof BookmarkItem)
              sendBookmarkFeeds(req, (BookmarkItem) newBookmark, req.getPartAsStringFailsafe("publicDescB", MAX_KEY_LENGTH));

            pageMaker.getInfobox("infobox-success", NodeL10n.getBase().getString("BookmarkEditorToadlet.addedNewBookmarkTitle"), content, "bookmark-add-new", false).
              addChild("p", NodeL10n.getBase().getString("BookmarkEditorToadlet.addedNewBookmark"));
View Full Code Here

Examples of freenet.clients.http.bookmark.BookmarkManager

      haveCalledFProxy = true;
    }
   
    pushDataManager=new PushDataManager(getTicker());
    intervalPushManager=new IntervalPusherManager(getTicker(), pushDataManager);
    bookmarkManager = new BookmarkManager(core, publicGatewayMode());
    try {
      FProxyToadlet.maybeCreateFProxyEtc(core, node, node.config, this);
    } catch (IOException e) {
      Logger.error(this, "Could not start fproxy: "+e, e);
      System.err.println("Could not start fproxy:");
View Full Code Here

Examples of net.sf.jftp.gui.tasks.BookmarkManager

            jftp.addToDesktop("Advanced Options", adv, 500, 180);
            jftp.setLocation(adv.hashCode(), 110, 180);
        }
        else if(e.getSource() == manage)
        {
            BookmarkManager m = new BookmarkManager();
            JFtp.desktop.add(m, new Integer(Integer.MAX_VALUE - 10));
        }
        else if(marks.contains(e.getSource()))
        {
            ((BookmarkItem) e.getSource()).connect();
View Full Code Here

Examples of org.albite.book.model.book.BookmarkManager

    private void fillBookmarks() {
        bookmarks = null;
        final List l = getBookmarks();

        final BookmarkManager bm =
                bookCanvas.getCurrentBook().getBookmarkManager();

        Bookmark b = bm.getFirst();

        while (b != null) {
            l.append(b.getTextForList(), null);
            b = b.getNext();
        }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.BookmarkManager

        this.rootDSE = null;

        this.schema = Schema.DEFAULT_SCHEMA;
        this.searchManager = new SearchManager( this );
        this.bookmarkManager = new BookmarkManager( this );

        this.entryToChildrenFilterMap = new HashMap();
        this.dnToEntryCache = new HashMap();
        this.entryToAttributeInfoMap = new HashMap();
        this.entryToChildrenInfoMap = new HashMap();
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.BookmarkManager

            connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_MODIFY_ORDER,
                ModifyOrder.DELETE_FIRST.getOrdinal() );
        }

        this.searchManager = new SearchManager( this );
        this.bookmarkManager = new BookmarkManager( this );

        this.entryToChildrenFilterMap = new HashMap<IEntry, String>();
        this.dnToEntryCache = new HashMap<String, IEntry>();
        this.entryToAttributeInfoMap = new HashMap<IEntry, AttributeInfo>();
        this.entryToChildrenInfoMap = new HashMap<IEntry, ChildrenInfo>();
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.BookmarkManager

            connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_BASE_DNS, true );
            connection.getConnectionParameter().setExtendedProperty( CONNECTION_PARAMETER_BASE_DN, "" );
        }

        this.searchManager = new SearchManager( this );
        this.bookmarkManager = new BookmarkManager( this );

        this.entryToChildrenFilterMap = new HashMap<IEntry, String>();
        this.dnToEntryCache = new HashMap<String, IEntry>();
        this.entryToAttributeInfoMap = new HashMap<IEntry, AttributeInfo>();
        this.entryToChildrenInfoMap = new HashMap<IEntry, ChildrenInfo>();
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.