Package com.ibm.sbt.util

Examples of com.ibm.sbt.util.DataNavigator$Xml


        ArrayList<FileEntry> entries = new ArrayList<FileEntry>();
        // Extract the content from the ATOM feed...
        XmlNavigator navigator = new XmlNavigator(document);
        //TODO Externalize these constants
        DataNavigator mynav = navigator.get("feed/entry");

        if (mynav != null) {
            String epName = accessor.findEndpointName();
            for (int i = 0; i < mynav.getCount(); i++) {
                FileEntry entry = new FileEntry();
                DataNavigator nav = mynav.get(i);
                entry.setUserId((String) UserBean.get().getPerson().getField(LOTUS_LIVE_SUBSCRIBER_ID));
                entry.setTitle(nav.stringValue("title"));
                entry.setUpdated(nav.dateValue("updated"));
                entry.setPublished(nav.dateValue("published"));
                entry.setAuthorName(nav.stringValue("author/name"));
               
                String id = nav.stringValue("id");
                if (StringUtil.isNotEmpty(id)) {
                    int index = id.indexOf("snx:file!");
                    if (index != -1) {
                        index = index + "snx:file!".length();
                        id = id.substring(index);
                    }
                }
                //hack
                id=id.replace("http://www.ibm.com/xmlns/prod/sn/cmis/00000000-0000-0000-0001-000000000000!", "");
                entry.setFileId(id);
                entry.setUniqueId(id);
                DataNavigator propsNavigator = nav.get("object/properties");

                String description = propsNavigator.get("propertyString").selectEq("@displayName", "Description").stringValue("value");
                entry.setDescription(StringUtil.getNonNullString(description));
                String size = propsNavigator.get("propertyInteger").selectEq("@propertyDefinitionId", "cmis:contentStreamLength").stringValue("value");
                entry.setSize(calculateBytes(size));
                String version = propsNavigator.get("propertyString").selectEq("@propertyDefinitionId", "cmis:versionLabel").stringValue("value");
                entry.setVersion(StringUtil.getNonNullString(version));
                String visibility = propsNavigator.get("propertyString").selectEq("@propertyDefinitionId", "snx:visibilityComputed").stringValue("value");
                entry.setVisibility(StringUtil.getNonNullString(visibility));
                String mimeType = propsNavigator.get("propertyString").selectEq("@propertyDefinitionId", "cmis:contentStreamMimeType").stringValue("value");
                entry.setMimeType(mimeType);
                entry.setIcon(MimeIconRegistry.getInstance().get(mimeType));
               
                String proxyUrl = "xsp/.proxy/files/" + entry.getTitle() + "?" + PARAM_TYPE + "=" + TYPE + "&" + PARAM_ID + "="
                        + entry.getFileId() + "&" + PARAM_REPOSITORY_ID + "=" + composeRepositoryID(entry) + "&"+"fileName="+entry.getTitle()+ "&" + PARAM_ENDPOINT_NAME
View Full Code Here


                ActivityStreamService svc = createService(findEndpointBean(),getServiceUrl());
                Map<String,String> parameters = getParameters(index, blockSize);

                //TODO Padraic Is this correct?
                DataNavigator.Json nav = new DataNavigator.Json(svc.getAllUpdates(parameters)); // this.data has the response feed.
          DataNavigator entry = nav.get("list");
               
                Object[] data = new Object[entry.getCount()];
                for(int i=0; i<data.length; i++) {
                    data[i] = entry.get(i);
                }
                return new ArrayBlock(index,data);
            } catch(Exception ex) {
                throw new FacesExceptionEx(ex,"Error while reading the Activity Streams");
            }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.util.DataNavigator$Xml

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.