コード例 #1
0
ファイル: Utils.java プロジェクト: papperwing/perun
  /**
   * Return URL to identity consolidator GUI with optional ?target= param having current Perun GUI
   * URL.
   *
   * @param target TRUE if use ?target= param in identity consolidator URL / FALSE otherwise
   * @return URL to identity consolidator
   */
  public static String getIdentityConsolidatorLink(boolean target) {

    // always use URL of machine, where GUI runs
    String baseUrl = Window.Location.getProtocol() + "//" + Window.Location.getHost();

    // FIXME - production consolidator is still using old URL scheme
    final String URL_KRB = baseUrl + "/perun-identity-consolidator-krb/";
    final String URL_FED = baseUrl + "/perun-identity-consolidator-fed/";
    final String URL_CERT = baseUrl + "/perun-identity-consolidator-cert/";
    String rpc = "";
    String link = "";

    if (PerunWebSession.getInstance().getRpcServer() != null) {
      rpc = PerunWebSession.getInstance().getRpcServer();
    }

    if (rpc.equalsIgnoreCase("krb")) {
      link = URL_KRB;
    } else if (rpc.equalsIgnoreCase("fed")) {
      link = URL_FED;
    } else if (rpc.equalsIgnoreCase("cert")) {
      link = URL_CERT;
    } else {
      // KRB AS BACKUP - "default"
      link = URL_KRB;
    }

    if (target) {
      link += "?target=" + Window.Location.getHref();
    }

    return link;
  }
コード例 #2
0
  /**
   * 非同期メッセージ送信メソッド
   *
   * @param message
   */
  public void sendAsyncMessage(JSONObject message) {

    String href = Window.Location.getHref();
    postMessage(message.toString(), href);

    addSendLog(message);
  }
コード例 #3
0
  /** Reads the configuration values defined by the bootstrap javascript. */
  private void loadFromDOM() {
    JsoConfiguration jsoConfiguration = getJsoConfiguration(id);
    serviceUrl = jsoConfiguration.getConfigString(ApplicationConstants.SERVICE_URL);
    if (serviceUrl == null || "".equals(serviceUrl)) {
      /*
       * Use the current url without query parameters and fragment as the
       * default value.
       */
      serviceUrl = Window.Location.getHref().replaceFirst("[?#].*", "");
    } else {
      /*
       * Resolve potentially relative URLs to ensure they point to the
       * desired locations even if the base URL of the page changes later
       * (e.g. with pushState)
       */
      serviceUrl = Util.getAbsoluteUrl(serviceUrl);
    }
    // Ensure there's an ending slash (to make appending e.g. UIDL work)
    if (!useServiceUrlPathParam() && !serviceUrl.endsWith("/")) {
      serviceUrl += '/';
    }

    vaadinDirUrl =
        Util.getAbsoluteUrl(jsoConfiguration.getConfigString(ApplicationConstants.VAADIN_DIR_URL));
    uiId = jsoConfiguration.getConfigInteger(UIConstants.UI_ID_PARAMETER).intValue();

    // null -> false
    standalone = jsoConfiguration.getConfigBoolean("standalone") == Boolean.TRUE;

    heartbeatInterval = jsoConfiguration.getConfigInteger("heartbeatInterval");

    communicationError = jsoConfiguration.getConfigError("comErrMsg");
    authorizationError = jsoConfiguration.getConfigError("authErrMsg");
    sessionExpiredError = jsoConfiguration.getConfigError("sessExpMsg");
  }
コード例 #4
0
ファイル: MailTabPanel.java プロジェクト: rebioma/rebioma
  public void save() {

    String frequency = month.getSelectedIndex() + "";
    String stat = statusButton.getValue() + "";
    String url = /*Window.Location.getUrl();*/ Window.Location.getHref().split("#", 2)[0];
    String day =
        DateTimeFormat.getFormat("yyyy-MM-dd").format(date.getValue())
            + " "
            + DateTimeFormat.getFormat("HH:mm:ss").format(time.getValue());
    //		Window.alert(frequency + " " + stat + " " + url + " " + day);
    mailingService.setMailing(
        stat,
        frequency,
        day,
        url,
        new AsyncCallback<Boolean>() {

          @Override
          public void onFailure(Throwable caught) {
            com.google.gwt.user.client.Window.alert("Error :" + caught.getMessage());
            save.setIcon(null);
            save.setEnabled(true);
          }

          @Override
          public void onSuccess(Boolean result) {
            com.google.gwt.user.client.Window.alert(result ? "Success!" : "Error!");
            save.setIcon(null);
            save.setEnabled(true);
          }
        });
  }
コード例 #5
0
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {
    panel.setWidget(view);

    GaeUserRequest request = rf.loginRequest();
    request
        .getCurrentUser()
        .to(
            new Receiver<GaeUserProxy>() {
              @Override
              public void onSuccess(GaeUserProxy user) {
                view.setNickname(user.getNickname());
              }
            });
    request
        .createLogoutURL(Window.Location.getHref())
        .to(
            new Receiver<String>() {
              @Override
              public void onSuccess(String url) {
                view.setLogoutURL(url);
              }
            });
    request.fire();
  }
コード例 #6
0
  /** 同期メッセージング(試作) */
  private void sendSyncMessage(JSONObject message) {
    debug.timeAssert("11/07/23 8:40:07", 0, "yieldが正式に全ブラウザに実装されるまでは使えない。");

    String href = Window.Location.getHref();
    postMessage(message.toString(), href);

    // この辺にyieldでメッセージ受信の受付を行えば良い

    addSendLog(message);
  }
コード例 #7
0
  public static String getGeodeskId() {

    String geodeskId = Window.Location.getHref();
    if (!geodeskId.contains(GdmLayout.geodeskPrefix)) {
      return null;
    }
    geodeskId =
        geodeskId.substring(
            geodeskId.indexOf(GdmLayout.geodeskPrefix) + GdmLayout.geodeskPrefix.length());
    geodeskId = geodeskId.substring(0, geodeskId.indexOf('/'));

    return geodeskId;
  }
コード例 #8
0
 /** Share the data by using FB. */
 private void onFbShareEvent() {
   MixpanelUtil.Click_On_FaceBook();
   if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PROFILE_PAGE)) {
     if (socialDo.getIsSearchShare()) {
       triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false);
       SocialShareView.postOnFacebook(
           socialDo.getTitle(), socialDo.getRawUrl(), description, categoryImage.getUrl());
       //				Window.open(
       //						"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="
       //								+ socialDo.getRawUrl() + "&p[images][0]="
       //								+ socialDo.getThumbnailurl() + "&p[title]="
       //								+ socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description,
       //								"_blank", "width=626,height=436");
     } else {
       triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false);
       String title = i18n.GL1995() + " " + i18n.GL1433();
       String token = Window.Location.getHref();
       SocialShareView.postOnFacebook(
           title,
           socialDo.getRawUrl(),
           getAsHtml(description) + " " + token,
           categoryImage.getUrl());
       //				Window.open(
       //						"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="
       //								+socialDo.getRawUrl() + "&p[images][0]="
       //								+ socialDo.getThumbnailurl() + "&p[title]="
       //								+ "Check out "+socialDo.getTitle().replaceAll("\\+", "%2B")+" on Gooru" +
       // "&p[summary]=" + description,
       //								"_blank", "width=626,height=436");
     }
   } else {
     triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false);
     SocialShareView.postOnFacebook(
         socialDo.getTitle(), socialDo.getRawUrl(), description, categoryImage.getUrl());
     //			Window.open(
     //					"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="
     //							+ socialDo.getRawUrl() + "&p[images][0]="
     //							+ socialDo.getThumbnailurl() + "&p[title]="
     //							+ socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description,
     //							"_blank", "width=626,height=436");
   }
 }
コード例 #9
0
  public void onModuleLoad() {
    GWT.log("FlashCards_App - onModuleLoad()");

    ShellStyleResource.INSTANCE.shellStyles().ensureInjected();
    ClientFactory clientFactory = GWT.create(ClientFactory.class);
    EventBus eventBus = clientFactory.getEventBus();
    PlaceController placeController = clientFactory.getPlaceController();

    User loggedInUser = clientFactory.getLoggedInUser();
    /*
    		if (loggedInUser == null) {
    			GWT.log("User is NOT logged in");
    			Cookies.setCookie("desitinationURL", Window.Location.getHref());
    			defaultPlace = new LoginPlace(ConstsUtil.LOGIN);
    		}
    		else {
    			GWT.log("Logged in user: "******"desitinationURL", Window.Location.getHref());
    defaultPlace = new ShellPlace(ConstsUtil.SHELL_VIEW);

    // start activity manager for our main widget with our ActivityMapper
    ActivityMapper activityMapper = new ShellActivityMapper(clientFactory);
    ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
    activityManager.setDisplay(appWidget);

    // start PlaceHistoryHandler with our PlaceHistoryMapper
    AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class);
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
    historyHandler.register(placeController, eventBus, defaultPlace);

    RootLayoutPanel.get().add(appWidget);

    historyHandler.handleCurrentHistory();
  }