Examples of GlobalController


Examples of com.salas.bb.core.GlobalController

     *
     * @param event original event object.
     */
    public void actionPerformed(ActionEvent event)
    {
        GlobalController controller = GlobalController.SINGLETON;
        GlobalModel model = controller.getModel();
        GuidesSet cgs = model.getGuidesSet();

        // Figure out if the publishing limit is already hit
        FeatureManager featureManager = GlobalController.SINGLETON.getFeatureManager();
        int pubLimit = featureManager.getPublicationLimit();
        boolean pubLimitReached = pubLimit > -1 && cgs.countPublishedGuides() >= pubLimit;

        boolean actAvailable = model.getServicePreferences().isAccountInformationEntered();
        AddGuideDialog dialog = new AddGuideDialog(controller.getMainFrame(), actAvailable, pubLimit, pubLimitReached);
        String urls = dialog.open(cgs);

        if (!dialog.hasBeenCanceled())
        {
            final String title = dialog.getGuideTitle();
            final String iconKey = dialog.getIconKey();
            final boolean autoFeedDiscovery = dialog.isAutoFeedDiscovery();

            StandardGuide guide = controller.createStandardGuide(title, iconKey, autoFeedDiscovery);
            if (guide != null)
            {
                // Propagate publishing information
                boolean publishingEnabled = dialog.isPublishingEnabled();
                guide.setPublishingEnabled(publishingEnabled);
                guide.setPublishingTitle(dialog.getPublishingTitle());
                guide.setPublishingTags(dialog.getPublishingTags());
                guide.setPublishingPublic(dialog.isPublishingPublic());
                guide.setPublishingRating(dialog.getPublishingRating() - 1);

                guide.setNotificationsAllowed(dialog.isNotificationsAllowed());

                ReadingList[] readingLists = dialog.getReadingLists();
                if (readingLists != null)
                {
                    for (ReadingList readingList : readingLists) guide.add(readingList);

                    // if there were reading lists -- update them immediately
                    if (readingLists.length > 0) controller.getPoller().update(guide);
                }

                // EDT !!!
                controller.selectGuide(guide, false);
                IFeed feed = controller.createDirectFeed(urls, false);
                if (feed != null) controller.selectFeed(feed);

                if (publishingEnabled) controller.showNewPublishingDialog();
            }
        }
    }
View Full Code Here

Examples of com.salas.bb.core.GlobalController

            if (link != null)
            {
                StringBuffer buf = new StringBuffer("<html><body>").append(link.toString());

                GlobalController controller = GlobalController.SINGLETON;
                FeedMetaDataHolder metaData = controller.discoverLinkFromArticle(link);
                if (metaData != null)
                {
                    URL xmlURL = metaData.getXmlURL();
                    NetworkFeed feed = controller.getModel().getGuidesSet().findDirectFeed(xmlURL);

                    if (feed == null)
                    {
                        if (metaData.isComplete() && metaData.isDiscoveredValid())
                        {
View Full Code Here

Examples of com.salas.bb.core.GlobalController

        {
            LinkType type;

            try
            {
                GlobalController controller = GlobalController.SINGLETON;
                String highlightedArticleLink = controller.getHighlightedArticleLink();
                if (highlightedArticleLink != null && highlightedArticleLink.equalsIgnoreCase(link))
                {
                    type = LinkType.SEARCH;
                } else
                {
                    FeedMetaDataHolder metaData = controller.discoverLinkFromArticle(new URL(link));
                    if (metaData != null && metaData.isDiscoveredValid())
                    {
                        type = LinkType.UNREGISTERED;

                        URL xmlURL = metaData.getXmlURL();
                        NetworkFeed feed = controller.getModel().getGuidesSet().findDirectFeed(xmlURL);

                        if (feed != null) type = LinkType.REGISTERED;
                    } else
                    {
                        type = LinkType.NORMAL;
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.