Package com.ibm.sbt.services.client.connections

Examples of com.ibm.sbt.services.client.connections.ConnectionsService


                                                                                                                                 
           String repositoryId = request.getParameter(AbstractType.PARAM_REPOSITORY_ID);                                                      
           // https://server/connections/files/basic/anonymous/api/library/repID/document/fileID/media/file.ext                  
           title = URLEncoder.encode(title, "UTF-8");                                                                            
           String serviceUrl = "files/basic/anonymous/api/library/" + repositoryId + "/document/" + fileId + "/media/" + title;  
           ConnectionsService svc = new ConnectionsService(bean);                                                                
           HandlerInputStream inputStream= new HandlerInputStream();                                                             
           Object httpResp = null;                                                                                               
                                                                                                                                 
           try {                                                                                                                 
             httpResp = svc.get(serviceUrl,inputStream).getData();                                                                       
                                                                                                                                 
           } catch (ClientServicesException e) {                                                                                 
               throw new FacesExceptionEx(e, "Failed to perform proxy request");                                                 
           }                                                                                                                     
                                                                                                                                 
View Full Code Here


                    if(!ep.isAuthenticated()) {
                        ep.authenticate(true);
                    }
                    try {
//                        ConnectionsService svc = new ConnectionsService(ep,"/profiles/atom/profileService.do");
                      ConnectionsService svc = new ConnectionsService(ep);
                      HandlerXml xml = new HandlerXml();
                        Document doc = (Document)svc.get("/profiles/atom/profileService.do",xml).getData();
                        XmlNavigator nav = new XmlNavigator(doc);
                        lcid = nav.get("service/workspace/collection/userid").stringValue(".");
                        privateData = true;
                    } catch(Exception e) {
                        e.printStackTrace();
                    }
                }
//                // This is obsolete - the call above is better as it handle servers where email access is disabled
//                // Try from the current user identity (might be the email)
//                if(lcid==null) {
//                    lcid = ep.getUserIdentity();
//                    privateData = true;
//                }
               
                if(StringUtil.isNotEmpty(lcid)) {
                    ConnectionsService svc = new ConnectionsService(ep);
                   
                    String key = lcid.indexOf('@')>=0 ? "email" : "userid";
                    Map<String, String> p = Collections.singletonMap(key, lcid);
                    HandlerXml xml = new HandlerXml();
                    Document doc = (Document)svc.get("/profiles/atom/profile.do",p,xml).getData();
                    XmlNavigator nav = new XmlNavigator(doc);
                    ProfilesData data = new ProfilesData();
                    DataNavigator entry = nav.get("feed/entry/content/div/span/div");
                    data.privateData = privateData;
                    data.lcname = nav.get("feed/entry/contributor/name").stringValue(".");
View Full Code Here

        }
       
        @Override
        protected Block loadBlock(int index, int blockSize) {
            try {
                ConnectionsService svc = createService(findEndpointBean(),getServiceUrl());
                Map<String,String> parameters = getParameters(index, blockSize);
               
                HandlerXml handler = new HandlerXml();
                Document doc = (Document)svc.get(getServiceUrl(),parameters, handler).getData();
               
                return new XmlBlock(index,doc);
            } catch(Exception ex) {
                throw new FacesExceptionEx(ex,"Error while reading the Connections entries");
            }
View Full Code Here

        }
       
        protected ConnectionsService createService(Endpoint endpoint, String serviceUrl) {
          //TODO Padraic
//            ConnectionsService svc = new ConnectionsService(endpoint,serviceUrl);
          ConnectionsService svc = new ConnectionsService(endpoint);
            return svc;
        }
View Full Code Here

     */
    public ClientService createClientService(Endpoint endpoint, String url) throws ClientServicesException {
        if(StringUtil.isEmpty(url)){
            url = "files/basic/api/introspection";
        }
        return new ConnectionsService(endpoint);
        //TODO - Padraic
//        return new ConnectionsService(endpoint, url);
    }
View Full Code Here

            String repositoryId = request.getParameter(PARAM_REPOSITORY_ID);
            // https://server/connections/files/basic/anonymous/api/library/repID/document/fileID/media/file.ext
            title = URLEncoder.encode(title, "UTF-8");
            String serviceUrl = "files/basic/anonymous/api/library/" + repositoryId + "/document/" + fileId + "/media/" + title;
            ConnectionsService svc = new ConnectionsService(bean);
            HandlerInputStream inputStream= new HandlerInputStream();
            Object file = null;

            try {
              file = svc.get(serviceUrl,inputStream).getData();

            } catch (ClientServicesException e) {
                throw new FacesExceptionEx(e, "Failed to perform proxy request");
            }
View Full Code Here

      return PLATFORM_CONNECTIONS;
    }
   
    @Override
  public ClientService getClientService() throws ClientServicesException {
      return new ConnectionsService(this);
    }
View Full Code Here

      return PLATFORM_CONNECTIONS;
    }

    @Override
  public ClientService getClientService() throws ClientServicesException {
      return new ConnectionsService(this);
    }
View Full Code Here

    /*
     * Create an instance of ConnectionsService.
     */
    ClientService getClientService() throws ClientServicesException {
        return new ConnectionsService(endpoint);
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.connections.ConnectionsService

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.