Package com.k42b3.zubat.basic

Examples of com.k42b3.zubat.basic.FormPanel


  {
    // load available services
    Services services = new Services(http, baseUrl);
    services.discover();

    ServiceItem request = services.getItem("http://oauth.net/core/1.0/endpoint/request");
    ServiceItem authorization = services.getItem("http://oauth.net/core/1.0/endpoint/authorize");
    ServiceItem access = services.getItem("http://oauth.net/core/1.0/endpoint/access");

    if(request == null)
    {
      throw new Exception("Could not find request service");
    }

    if(authorization == null)
    {
      throw new Exception("Could not find authorization service");
    }

    if(access == null)
    {
      throw new Exception("Could not find access service");
    }

    return new OauthProvider(request.getUri(), authorization.getUri(), access.getUri(), consumerKey, consumerSecret);
  }
View Full Code Here


      // oauth config
      availableServices = new Services(http, Configuration.getInstance().getBaseUrl());
      availableServices.discover();

      ServiceItem request = availableServices.getItem("http://oauth.net/core/1.0/endpoint/request");
      ServiceItem authorization = availableServices.getItem("http://oauth.net/core/1.0/endpoint/authorize");
      ServiceItem access = availableServices.getItem("http://oauth.net/core/1.0/endpoint/access");

      if(request == null)
      {
        throw new Exception("Could not find request service");
      }

      if(authorization == null)
      {
        throw new Exception("Could not find authorization service");
      }

      if(access == null)
      {
        throw new Exception("Could not find access service");
      }

      OauthProvider provider = new OauthProvider(request.getUri(), authorization.getUri(), access.getUri(), Configuration.getInstance().getConsumerKey(), Configuration.getInstance().getConsumerSecret());
      oauth = new Oauth(http, provider);
    }
    catch(Exception e)
    {
      Zubat.handleException(e);
View Full Code Here

    }
  }

  private void fetchAccount() throws Exception
  {
    ServiceItem item = getAvailableServices().getItem("http://ns.amun-project.org/2011/amun/service/my/verifyCredentials");

    if(item != null)
    {
      account = Account.buildAccount(http.requestXml(Http.GET, item.getUri()));
    }
    else
    {
      throw new Exception("Could not discover user informations");
    }
View Full Code Here

    http.setOauth(oauth);
  }

  public void onReady() throws Exception
  {
    ServiceItem item = availableServices.getItem("http://ns.amun-project.org/2011/amun/content/page");

    if(item != null)
    {
      loadContainer(item);
View Full Code Here

    JMenu menu = new JMenu(baseTitle);

    for(int i = 0; i < services.getSize(); i++)
    {
      ServiceItem item = services.getElementAt(i);
      String type = item.getTypeStartsWith(baseUrl);

      if(type != null)
      {
        int deep = this.charCount('/', type);
        String title = type.substring(type.lastIndexOf("/") + 1);
View Full Code Here

  }
 
  public static OauthProvider discoverProvider(Http http, String baseUrl, String consumerKey, String consumerSecret) throws Exception
  {
    // load available services
    Services services = new Services(http, baseUrl);
    services.discover();

    ServiceItem request = services.getItem("http://oauth.net/core/1.0/endpoint/request");
    ServiceItem authorization = services.getItem("http://oauth.net/core/1.0/endpoint/authorize");
    ServiceItem access = services.getItem("http://oauth.net/core/1.0/endpoint/access");

    if(request == null)
    {
      throw new Exception("Could not find request service");
    }
View Full Code Here

      this.add(trafficPanel, BorderLayout.CENTER);


      // oauth config
      availableServices = new Services(http, Configuration.getInstance().getBaseUrl());
      availableServices.discover();

      ServiceItem request = availableServices.getItem("http://oauth.net/core/1.0/endpoint/request");
      ServiceItem authorization = availableServices.getItem("http://oauth.net/core/1.0/endpoint/authorize");
      ServiceItem access = availableServices.getItem("http://oauth.net/core/1.0/endpoint/access");
View Full Code Here

  }

  private void doAuthentication() throws Exception
  {
    // fetch services
    availableServices = new Services(http, Configuration.getInstance().getBaseUrl());
    availableServices.discover();

    // authentication
    String requestUrl = availableServices.getItem("http://oauth.net/core/1.0/endpoint/request").getUri();
    String authorizationUrl = availableServices.getItem("http://oauth.net/core/1.0/endpoint/authorize").getUri();
View Full Code Here

    this.add(this.buildInfo());
  }

  private JMenu buildMenu(String baseUrl)
  {
    Services services = zubat.getAvailableServices();

    int baseDeep = this.charCount('/', baseUrl) + 1;
    String baseTitle = baseUrl.substring(baseUrl.lastIndexOf("/") + 1);
    baseTitle = (baseTitle.charAt(0) + "").toUpperCase() + baseTitle.substring(1).toLowerCase();

    JMenu menu = new JMenu(baseTitle);

    for(int i = 0; i < services.getSize(); i++)
    {
      ServiceItem item = services.getElementAt(i);
      String type = item.getTypeStartsWith(baseUrl);

      if(type != null)
      {
        int deep = this.charCount('/', type);
View Full Code Here

   

    // log traffic
    if(trafficListener != null)
    {
      TrafficItem trafficItem = new TrafficItem();

      trafficItem.setRequest(request);
      trafficItem.setResponse(httpResponse);
      trafficItem.setResponseContent(responseContent);

      trafficListener.handleRequest(trafficItem);
    }

View Full Code Here

TOP

Related Classes of com.k42b3.zubat.basic.FormPanel

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.