Package org.eurekastreams.web.client.ui.common.notifier

Examples of org.eurekastreams.web.client.ui.common.notifier.Notification


                    {
                        Session.getInstance().getEventBus().notifyObservers(
                                new UpdateHistoryEvent(new CreateUrlRequest(Page.GALLERY, tabParams)));
                        tabTemplateTab.reload();
                        Session.getInstance().getEventBus().notifyObservers(
                                new ShowNotificationEvent(new Notification("Your tab has been successfully added")));
                    }
                });

        Session.getInstance().getEventBus().addObserver(UpdatedGalleryTabTemplateResponseEvent.class,
                new Observer<UpdatedGalleryTabTemplateResponseEvent>()
                {
                    public void update(final UpdatedGalleryTabTemplateResponseEvent arg1)
                    {
                        Session.getInstance().getEventBus().notifyObservers(
                                new UpdateHistoryEvent(new CreateUrlRequest(Page.GALLERY, tabParams)));
                        tabTemplateTab.reload();
                        Session.getInstance().getEventBus().notifyObservers(
                                new ShowNotificationEvent(new Notification("Your tab has been successfully saved")));
                    }
                });

        Session.getInstance().getEventBus().addObserver(AddTabFromGalleryTabTemplateResponseEvent.class,
                new Observer<AddTabFromGalleryTabTemplateResponseEvent>()
                {
                    public void update(final AddTabFromGalleryTabTemplateResponseEvent arg1)
                    {
                        String text = "Tab has been applied";

                        // since a refresh happens in IE7 when navigating to the start page, show the notification
                        // by passing in a notification url parameter
                        if (MasterComposite.getUserAgent().contains("msie 7"))
                        {
                            Map<String, String> parameters = new HashMap<String, String>();
                            parameters.put(UINotifier.NOTIFICATION_PARAM, text);

                            Session.getInstance().getEventBus().notifyObservers(
                                    new UpdateHistoryEvent(new CreateUrlRequest(Page.START, "", parameters)));
                        }
                        // otherwise, throw the notification event as normal
                        else
                        {
                            Session.getInstance().getEventBus().notifyObservers(
                                    new UpdateHistoryEvent(new CreateUrlRequest(Page.START)));

                            Session.getInstance().getEventBus().notifyObservers(
                                    new ShowNotificationEvent(new Notification(text)));
                        }
                    }
                });
    }
View Full Code Here


        Session.getInstance().getEventBus().addObserver(CommentDeletedEvent.class, new Observer<CommentDeletedEvent>()
        {
            public void update(final CommentDeletedEvent arg1)
            {
                Session.getInstance().getEventBus()
                        .notifyObservers(new ShowNotificationEvent(new Notification("Comment has been deleted")));

                if (inMessageId.equals(arg1.getMessageId()))
                {
                    commentCount--;
                    if (commentCount <= 2)
View Full Code Here

            }
        }, new OnFailureCommand()
        {
            public void onFailure(final Throwable inEx)
            {
                eventBus.notifyObservers(new ShowNotificationEvent(new Notification(
                        inEx instanceof AuthorizationException ? "Not allowed to post to this stream."
                                : "Error posting to stream.")));
            }
        });
    }
View Full Code Here

                                    linkInformation));
                            eventBus.notifyObservers(event);

                            eventBus.notifyObservers(new
                            // line break.
                            ShowNotificationEvent(new Notification(UNVERIFIED_URL_MESSAGE)));
                        }

                        public void onSuccess(final LinkInformation result)
                        {
                            MessageAttachmentChangedEvent event = new MessageAttachmentChangedEvent(new Bookmark(
View Full Code Here

                {
                    public void update(final DeletedStreamPluginSubscriptionResponseEvent event)
                    {
                        renderInsides();
                        Session.getInstance().getEventBus().notifyObservers(
                                new ShowNotificationEvent(new Notification("Stream plugin has been deleted")));
                    }
                });

        Session.getInstance().getEventBus().addObserver(InsertedStreamPluginSubscriptionResponseEvent.class,
                new Observer<InsertedStreamPluginSubscriptionResponseEvent>()
                {
                    public void update(final InsertedStreamPluginSubscriptionResponseEvent arg1)
                    {
                        renderInsides();
                        Session.getInstance().getEventBus().notifyObservers(
                                new ShowNotificationEvent(
                                        new Notification("Stream Plugin has been successfully added.")));
                    }
                });

        Session.getInstance().getEventBus().addObserver(UpdatedStreamPluginSubscriptionResponseEvent.class,
                new Observer<UpdatedStreamPluginSubscriptionResponseEvent>()
                {
                    public void update(final UpdatedStreamPluginSubscriptionResponseEvent arg1)
                    {
                        renderInsides();
                        Session.getInstance().getEventBus().notifyObservers(
                                new ShowNotificationEvent(new Notification(
                                        "Stream Plugin has been successfully updated.")));
                    }
                });

        renderInsides();
View Full Code Here

        eventBus.addObserver(InsertedRequestForGroupMembershipResponseEvent.class,
                new Observer<InsertedRequestForGroupMembershipResponseEvent>()
                {
                    public void update(final InsertedRequestForGroupMembershipResponseEvent inArg1)
                    {
                        eventBus.notifyObservers(new ShowNotificationEvent(new Notification(
                                "Your request for access has been sent")));

                        // TODO disable button instead
                        clear();
                        Label sent = new Label("Request Sent");
View Full Code Here

        eventBus.addObserver(DeletedActivityResponseEvent.class, new Observer<DeletedActivityResponseEvent>()
        {
            public void update(final DeletedActivityResponseEvent ev)
            {
                eventBus.notifyObservers(new ShowNotificationEvent(new Notification("Activity has been deleted")));
            }
        });
    }
View Full Code Here

            {
                Session.getInstance().getEventBus().notifyObservers(
                        new UpdateHistoryEvent(new CreateUrlRequest(Page.GROUPS, arg1.getResponse().getShortName())));

                Session.getInstance().getEventBus().notifyObservers(
                        new ShowNotificationEvent(new Notification("Your group has been successfully saved")));
            }
        });

        form.addFormElement(new ValueOnlyFormElement(DomainGroupModelView.ID_KEY, Long.toString(entity.getId())));
        form.addFormElement(new ValueOnlyFormElement(DomainGroupModelView.SHORT_NAME_KEY, entity.getShortName()));

        AvatarUploadFormElement avatarFormEl = new AvatarUploadFormElement("Avatar",
                "Select a JPG, PNG or GIF image from your computer. The maxium file size is 4MB",
                "/eurekastreams/groupavatarupload?groupName=" + entity.getShortName(), Session.getInstance()
                        .getActionProcessor(), new AvatarUploadStrategy<DomainGroupModelView>(entity,
                        "resizeGroupAvatar", EntityType.GROUP));
        form.addWidget(avatarFormEl);

        form.addFormDivider();

        form.addFormElement(new BasicTextBoxFormElement(MAX_NAME, false, "Group Name", DomainGroupModelView.NAME_KEY,
                entity.getName(), "", true));
        form.addFormDivider();

        form.addFormElement(new BasicTextAreaFormElement(DomainGroup.MAX_DESCRIPTION_LENGTH, "Description",
                DomainGroupModelView.DESCRIPTION_KEY, entity.getDescription(),
                "Enter a few sentences that describe the purpose of your group's stream.  "
                        + "This description will appear beneath your avatar "
                        + "and in the profile search results pages.", false));

        form.addFormDivider();

        AutoCompleteItemDropDownFormElement keywords = new AutoCompleteItemDropDownFormElement("Keywords",
                DomainGroupModelView.KEYWORDS_KEY, DomainFormatUtility.buildCapabilitiesStringFromStrings(entity
                        .getCapabilities()),
                "Add keywords that describe your group and the topics your members will be talking about. Separate "
                        + "keywords with a comma. Including keywords helps others find your group when searching "
                        + "profiles.", false, "/resources/autocomplete/capability/", "itemNames", ",");
        keywords.setMaxLength(MAX_KEYWORDS);

        form.addFormElement(keywords);
        form.addFormDivider();

        form.addFormElement(new BasicTextBoxFormElement("Website URL", "url", entity.getUrl(),
                "If your group has a website, you can enter the URL above", false));
        form.addFormDivider();

        String coordinstructions = "The group coordinators will be responsible for managing the organization profile, "
                + "and moderating the group's activity stream";

        form.addFormElement(new PersonModelViewLookupFormElement("Group Coordinators", "Add Coordinator",
                coordinstructions, DomainGroupModelView.COORDINATORS_KEY, entity.getCoordinators(), true));

        form.addFormDivider();

        final Label currentPrivacySettingLabel = new Label();
        currentPrivacySettingLabel.setText("Privacy Settings");
        currentPrivacySettingLabel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formLabel());
        final FlowPanel currentPrivacySettingDescription = new FlowPanel();
        final Label currentPrivacySettingDescriptionTitle = new Label();
        currentPrivacySettingDescriptionTitle.setText(entity.isPublic() ? "Public" : "Private");
        currentPrivacySettingDescriptionTitle.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formStaticValue());
        final Label currentPrivacySettingDescriptionInfo = new Label();
        if (entity.isPublic())
        {
            currentPrivacySettingDescriptionInfo.setText("Public groups are visible to all users and accessible "
                    + "through a profile search.");
        }
        else
        {
            currentPrivacySettingDescriptionInfo.setText("Access to private groups is restricted to employees"
                    + " approved by the group's coordinators.  Group coordinators can view a list of pending "
                    + "requests by going to the admin tab on the group's profile.");
        }
        currentPrivacySettingDescriptionInfo.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formInstructions());
        currentPrivacySettingDescription.add(currentPrivacySettingDescriptionTitle);
        currentPrivacySettingDescription.add(currentPrivacySettingDescriptionInfo);
        currentPrivacySettingDescription.addStyleName(StaticResourceBundle.INSTANCE.coreCss().privacySettingsValue());
        final FlowPanel currentPrivacySettingPanel = new FlowPanel();
        currentPrivacySettingPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formElement());
        currentPrivacySettingPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().privacySettings());
        currentPrivacySettingPanel.add(currentPrivacySettingLabel);
        currentPrivacySettingPanel.add(currentPrivacySettingDescription);
        form.addWidget(currentPrivacySettingPanel);

        if (!entity.isPublic())
        {
            final HTML privateNote = new HTML("<span class=\"form-static-value\">Please Note:</span> "
                    + "This group's name and description will be visible whenever employees browse or"
                    + " search profiles.");
            privateNote.addStyleName(StaticResourceBundle.INSTANCE.coreCss().privacySettingsNote());
            privateNote.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formInstructions());
            currentPrivacySettingPanel.add(privateNote);
        }

        form.addFormDivider();

        // TODO: evidently this is supposed to go away
        BasicCheckBoxFormElement blockWallPost = new BasicCheckBoxFormElement("Stream Moderation",
                DomainGroupModelView.STREAM_POSTABLE_KEY, "Allow others to post to your group's stream", false, entity
                        .isStreamPostable());
        BasicCheckBoxFormElement blockCommentPost = new BasicCheckBoxFormElement(null,
                DomainGroupModelView.STREAM_COMMENTABLE_KEY,
                "Allow others to comment on activity in your group's stream", false, entity.isCommentable());

        blockWallPost.addStyleName(StaticResourceBundle.INSTANCE.coreCss().streamModeration());
        blockCommentPost.addStyleName(StaticResourceBundle.INSTANCE.coreCss().streamModeration());
        blockCommentPost.addStyleName(StaticResourceBundle.INSTANCE.coreCss().commentModeration());

        form.addFormElement(blockWallPost);
        form.addFormElement(blockCommentPost);
        form.addFormDivider();

        // ---- Action buttons ----

        deleteButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formDeleteGroupButton());
        deleteButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formButton());

        deleteButton.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                if (new WidgetJSNIFacadeImpl().confirm("Are sure that you want to delete this group? "
                        + "Deleting the group will remove the profile from the system along with "
                        + "all of the activity that has been posted to its stream."))
                {
                    form.turnOffChangeCheck();
                    processingSpinny.setVisible(true);
                    deleteButton.setVisible(false);

                    // TODO - might should put this in GroupModel (and mark it as Deletable) but there's no
                    // custom onFailure ability there yet.
                    Session.getInstance().getActionProcessor().makeRequest("deleteGroupAction", entity.getId(),
                            new AsyncCallback<Boolean>()
                            {
                                public void onSuccess(final Boolean result)
                                {
                                    // adds notification to top of page
                                    Session.getInstance().getEventBus().notifyObservers(
                                            new ShowNotificationEvent(new Notification("The group '"
                                                    + entity.getName() + "' has been deleted")));

                                    // navigates away from settings page to the parent org profile page
                                    Session.getInstance().getEventBus().notifyObservers(
                                            new UpdateHistoryEvent(new CreateUrlRequest(Page.PEOPLE, Session
                                                    .getInstance().getCurrentPerson().getAccountId())));
                                }

                                public void onFailure(final Throwable caught)
                                {
                                    // adds notification to top of page
                                    Session.getInstance().getEventBus().notifyObservers(
                                            new ShowNotificationEvent(new Notification(
                                                    "An error has occured and the group '" + entity.getName()
                                                            + "' was not deleted")));
                                }
                            });
                }
View Full Code Here

        eventBus.addObserver(AddedFeaturedStreamResponseEvent.class, new Observer<AddedFeaturedStreamResponseEvent>()
        {
            public void update(final AddedFeaturedStreamResponseEvent event)
            {
                eventBus.notifyObservers(new ShowNotificationEvent(new Notification("Stream has been featured.")));
            }
        });

        eventBus.addObserver(UpdatedGroupStickyActivityEvent.class, new Observer<UpdatedGroupStickyActivityEvent>()
        {
View Full Code Here

                          public void update(final InsertedRequestForGroupMembershipResponseEvent inArg1)
                          {
                              button.disable();
                              EventBus.getInstance()
                                      .notifyObservers(
                                              new ShowNotificationEvent(new Notification(
                                                      "Your request for access has been sent")));
                          }
                      });
 
              button.addStyleName(StaticResourceBundle.INSTANCE.coreCss().requestAccessButton());
View Full Code Here

TOP

Related Classes of org.eurekastreams.web.client.ui.common.notifier.Notification

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.