Package com.ibm.sbt.services.client.ClientService

Examples of com.ibm.sbt.services.client.ClientService.HandlerXml


                        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;
View Full Code Here


        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

    public List<FileEntry> readFileEntries(ClientService svc, RestDataBlockAccessor accessor, Map<String, String> params, String serviceUrl)
            throws ClientServicesException {
        ArrayList<FileEntry> fileEntries = new ArrayList<FileEntry>();
        if (svc != null) {
           
          HandlerXml xml = new HandlerXml();
          Object result = svc.get("/files/basic/api/introspection",params, xml).getData();
           
            if (result instanceof Document) {
                XmlNavigator workspacesNavigator = new XmlNavigator((Document) result);
                DataNavigator filesNavigator = workspacesNavigator.get(TAG_SERVICE + "/" + TAG_WORKSPACE).selectEq(TAG_TITLE, ATTR_VAL_FILES);
View Full Code Here

    }

    public List<FileEntry> readFileEntries(ClientService svc, RestDataBlockAccessor accessor, Map<String, String> params,String serviceUrl)
            throws ClientServicesException {
        authenticate(accessor);
        HandlerXml xml = new HandlerXml();
        Document document = (Document) svc.get("files/basic/cmis/repository",params,xml).getData();

        ArrayList<FileEntry> entries = new ArrayList<FileEntry>();
        // Extract the content from the ATOM feed...
        XmlNavigator navigator = new XmlNavigator(document);
View Full Code Here

 
 
 
  public static String getCommunityXMLString(){
    ConnectionsService svc = new sbt.ConnectionsService("connections");
    HandlerXml handlerXML= new HandlerXml();
    Document msg=null;
    String xmlText = null;
    try {
      msg = (Document)svc.get("/communities/service/atom/communities/all",handlerXML).getData();
      xmlText =DOMUtil.getXMLString(msg)
View Full Code Here

    }
    return null;
  }
  public static String getActivityXMLString(){
    ConnectionsService svc = new sbt.ConnectionsService("connections");
    HandlerXml handlerXML= new HandlerXml();
    Document msg=null;
    String xmlText = null;
    try {
      msg = (Document)svc.get("/activities/service/atom2/everything",handlerXML).getData();
      xmlText =DOMUtil.getXMLString(msg)
View Full Code Here

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

   * Method to retrieve the response as XML.
   * @return an XML representation of the response
   * @throws ClientServicesException
   */
  public Response<Node> asXml() throws ClientServicesException {
    return response(new HandlerXml(), Node.class);
  }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.ClientService.HandlerXml

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.