Giter VIP home page Giter VIP logo

socialsdk's Introduction

Welcome to the IBM Social Business Toolkit SDK!

The Social Business Toolkit SDK is a set of libraries and code samples that you use for connecting to the IBM Social Platform. It covers many products like IBM Connections, IBM Notes/Domino, IBM Sametime. It includes support for many authentication mechanisms, as well as comprehensive wrappers for the REST APIs.
The SDK can be run on Java-based application servers such WebSphere Application Server, WebSphere Portal, IBM Domino, and Apache Tomcat.
A built version is distributed on OpenNTF at http://ibmsbt.openntf.org and on the releases tab https://github.com/OpenNTF/SocialSDK/releases 

OPENNTF
    This project is an OpenNTF project, and is available under the Apache License V2.0.  
    All other aspects of the project, including contributions, defect reports, discussions, 
    feature requests and reviews are subject to the OpenNTF Terms of Use - available at 
    http://openntf.org/Internal/home.nsf/dx/Terms_of_Use.

socialsdk's People

Contributors

andrewegan avatar benjamij avatar bhavesh1976 avatar darinegan avatar davetobin avatar daviryan avatar happyclamb avatar lorenzoboccaccia avatar maire-kehoe avatar manishkataria avatar markdebhailis avatar markewallace avatar martindonnelly avatar martinholland avatar padraic-edwards avatar prb112 avatar projsaha avatar ryanjbaxter avatar simonberryb avatar swatisingh10 avatar vimaldhupar avatar vineetkanwal1 avatar zipwiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

socialsdk's Issues

Member objects for Community Members do not contain CommunityUUID

The Community ID is missing from the Activity Member object

For example, the response from http://<CONNECTIONS_URL>/activities/service/atom2/forms/acl?activityUuid=<ACTIVITY_UUID> (where ACTIVITY_UUID> is substituted for the id of the Activity) contains 3 IDs; MemberId, UserId & CommunityUUID.

image

Compared to the SBT Member object which only contains 2; MemberId & UserId.

OAuth2Handler: ForceTrustSSLCertificate is not implemented in "_renewToken"

The forceTrustSSLCertificate is not implemented in all places.

I get a "javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated" exception at the internal method "protected AccessToken _renewToken(AccessToken token)".

This code is missing there

if(forceTrustSSLCertificate)
  client = (DefaultHttpClient)SSLUtil.wrapHttpClient((DefaultHttpClient)client);

Community tags do not get rendered properly

If I create a community with a tag like mountain climbing, it gets posted as one tag and even on native ui shows up as one tag.
However while reading community object in SDK, 2 different tags are returned mountain and climbing.

Java API: Forums Retrieved from Community Object

Per Yasser:
The SDK doesn't have an equivalent method to get forums for a given community id. The method exists in the javascript snippet and REST API.

Is this something that will be included in the new sdk or any plan to include it?
ie: javascript has:
communityService.getForums();

no X-Sametime-resolve in ProfileVCard.html

Hi ,
SBT is about connections, and connection's support sametime so vcard should have X-Sametime-resolve as class attribute else sametime awareness does not work.

Content of ProfileVCard.html and Inline version content should be

${userName}
${userId}

Dilip

Css issues when running controls inside the script portlet

When running controls in the script portlet,in particular the views, there are css issues. When you click one of the view actions for example in the files view, upload file. the diaplog box has no css. There are some minor styling issues with some of the grid controls also.

Attachment not found

Hi,

When I use the method createActivityStreamEntryObject in ActivityStreamEntry Class.
The Attachment is not detected in the response.

The problem come from fetchAttachment :

// BEFORE :  DataNavigator SUAttachments = object.get("attachments");
Solution -> DataNavigator SUAttachments = object.get(0).get("attachments");

Moreover, the flag isContainAttachment is not setting automatically.
You need to add in createActivityStreamEntryObject

Attachment attachment = fetchAttachment(object); // fetch attachments
entryObj.setAttachment(attachment);
if (attachment.getId() !=null) {
entryObj.setContainAttachment(true);
}

Regards,

maven build fails

The maven build in the latest release fails using the included build.cmd.
The prior release works fine.
I rely on the latest release tag to deploy the toolkit with the build.cmd.
Would it be possible to test this bevor publishing a new release?
Thank you.

Modify CommunityService to Create SubCommunity

https://github.com/OpenNTF/SocialSDK/blob/master/src/eclipse/plugins/com.ibm.sbt.core/src/com/ibm/sbt/services/client/connections/communities/CommunityService.java

Create a more generic method for createCommunity
Line 605
public String createCommunity(Community community) throws CommunityServiceException {
if (null == community){
throw new CommunityServiceException(null, Messages.NullCommunityObjectException);
}

            try {
                    Object communityPayload;
                    try {
                            communityPayload = community.constructCreateRequestBody();
                    } catch (TransformerException e) {
                            throw new CommunityServiceException(e, Messages.CreateCommunityPayloadException);
                    }
                    String communityPostUrl = resolveCommunityUrl(CommunityEntity.COMMUNITIES.getCommunityEntityType(),CommunityType.MY.getCommunityType());
                    Response requestData = createData(communityPostUrl, null, communityPayload,ClientService.FORMAT_CONNECTIONS_OUTPUT);
                    community.clearFieldsMap();
                    return extractCommunityIdFromHeaders(requestData);
            } catch (ClientServicesException e) {
                    throw new CommunityServiceException(e, Messages.CreateCommunityException);
            } catch (IOException e) {
                    throw new CommunityServiceException(e, Messages.CreateCommunityException);
            }
    }

Modify the communityPostUrl as a parameter...

You'll want to change your communityPostUrl to match...
https://greenhouse.lotus.com/communities/service/atom/community/subcommunities?communityUuid=2fba29fd-adfa-4d28-98cc-05cab12a7c43

and also a more generic createCommunity without parent

and where the Uuid here is the parent uuid.

getAsDate in XmlDataHandler uses local timezone to parse a date

SmartCloud uses UTC times, for example when retrieving activity todo's:

<updated>2014-06-05T07:20:07Z</updated>

getAsDate creates a new SimpleDateFormat and then parses the date. There is no timezone set, so SimpleDateFormat uses the default timezone. In my case the UTC date gets parsed as CEST.

Could this be fixed so that it uses UTC as timezone on the SimpleDateFormat: format.setTimeZone(TimeZone.getTimeZone("UTC"));
Then the parsed Date.getTime returns the milliseconds since January 1, 1970, 00:00:00 UTC (epoch).

Maybe other datahandlers like the JsonDataHandler have the same issue, but I haven't looked into that.

Services in SocialSDK are not serializable

In order to properly consume and cache some REST services results in a server side Java framework, then the classes ("entities") have to be serializable (by implementing Serializable)

SEN: Retrieving tags on a File

The SBT does have a method to get the tags on a file (File.getTags()), which is what we have been using; however it doesn't work.  We now know why - it's because the REST call that they make to get the file metadata doesn't include this "includeTags" parameter, so the Atom that they are parsing and trying to extract the tags from doesn't include the tags content. 

SBT Does not work in IE8

Below html which included just the library servlet does not work in IE and gives error

Expected identifier, string or number dojo.js, line 15 character 13023

<script type="text/javascript" src="/sbt.dojo180/dojo/dojo.js"></script> <script type="text/javascript" src="/searchApplication/library?lib=dojo&ver=1.8"></script> hello thjere

com.ibm.commons.runtime.util.UrlUtil.makeUrlAbsolute() and XPiNC

Trying to use XPages Social Enabler app in XPiNC, in preparation for using SBT in a customer project.

However, when I click the login button to log into Connections, I'm getting the following error: "Error 404: ProxyServlet: /XPagesSBT.nsf/_BasicLogin.xsp"

The logins use the method endpoint.authenticate(true), for example on BasicAuthenticationPanel Custom Control, used to handle all authentications to e.g. Connections, Sametime etc. I've tracked this through in the source code to com.ibm.commons.runtime.util.UrlUtil.makeUrlAbsolute(). This uses request.getServerName() and request.getServerPort().

If using an XPages app that's local or on my local server, I'm finding getServerName() is return "127.0.0.1" and getServerPort() is returning "55325". So the URL it's trying to go to is "http://127.0.0.1:55325/XPagesSBT/_BasicLogin.xsp", which is failing.

For XPiNC it needs to omit the server port. "http://127.0.0.1/XPagesSBT/_BasicLogin.xsp" works for me.

However, I'm not sure how you can check for XPiNC and code accordingly, without then having dependencies on XPages packages, which would break other implementations on SBT.

connectionsData datasources broken in XPages SBT Demo

The datasources go through XMLArrayBlockAccessor's XmlBlock.readExternal

This sets this.doc = XmlSerializer.readDOMObject(in)

XmlSerializer.readDOMObject() does not appear to be fully implemented yet. It just throws an UnsupportedOperationException "Only available from domino/xpages deployments", even though I'm in an XPages app.

So the XPages demo app's demos of IBM Connections > Activities and Communities don't work.

The code still seems to be the same in the other branch of the project.

ActivityStreamEntry Actor: The uid is maybe wrong

The UID of the Actor of an ActivityStreamEntry contains to many characters

I get this if I get the entry list with "getActivityStream('@me', '@ALL', '@ALL', header);"

urn:lsid:lconn.ibm.com:profiles.person:835089c0-1a1d-1032-8b39-c90c9bc07561&lang=de_de

Correct should be
835089c0-1a1d-1032-8b39-c90c9bc07561

Issues using tagging and wall post services on Alpha (Cell 02)

We are recently facing issues using tagging and wall post services listed below.

tagging service: https:///profiles/atom/profileTags.do
wall post service:https:///common/opensocial/rest/ublog/(userid)/@ALL

We use SBT library to call them ,here is the error thrown by client classes.

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[5/28/14 14:25:34:568 IST] 00000226 SystemErr R 2396462370 [WebContainer : 8] INFO org.apache.bval.jsr303.ConfigurationImpl - ignoreXmlConfiguration == true
[5/28/14 14:25:49:452 IST] 00000226 SystemErr R com.ibm.sbt.services.client.ClientServicesException: Request to url https:///profiles/atom/profileTags.do?sourceKey=ab16c549-1d93-4156-a350-02c191323c51&targetKey=075029a8-c108-4356-a62e-ff6c27507886&extensionAware=true returned an error response 403:Forbidden org.apache.http.message.BasicHttpResponse@77c55fd1
[5/28/14 14:25:49:452 IST] 00000226 SystemErr R at com.ibm.sbt.services.client.ClientService.throwClientServicesException(ClientService.java:1350)

Kindly help to resolve the issue or give potential reasons of the failures. Let me know if you need more details regarding the issue.

These jars we used:
com.ibm.sbt.core-1.0.0.20140125-1133.jar
com.ibm.sbt.samples.commons-1.0.0.20140125-1133.jar

Connections instance version:
connections instance versions to be 4.6

Twitter connect doesn´t work in Domino 9.0

Hello,

i am trying to get the SDK working with Twitter.

Everything went fine, until i am trying to authorize the app on Twitter. I get the “authorize app” screen, i provide the allowence, the Twitter site redirects to the XPagesSBT.nsf.

Using the latest version of the social enabler XPages Social Enabler Version: 901_201311181140 and the provided site.xml update site.

Here again, the website loads the Twitter Authorize screen and so on. This issue can be handled hours and hours. Every time when the Twitter Authorize screen redirects to/XPagesSBT.nsf/ i can see in the error in the console log:

[2074:000A-2100] 13.01.2014 13:50:14 HTTP JVM: CLFAD0211E: Exception thrown. F
or more detailed information, please consult error-log-0.xml located in D:/Lotus
DominoData/domino/workspace/logs
[2074:000A-2100] 13.01.2014 13:50:14 HTTP JVM: CLFAD0246E: Exception occurred
servicing request for:/development/XPagesSBT.nsf/Twitter.xsp - HTTP Code: 500.
For more detailed information, please consult error-log-0.xml located in D:/Lotu
sDominoData/domino/workspace/logs

I tried several version, all have the same issue.

Issue is also reproduceable for domino 8.5.3

Authentication does not interrupt flow of execution

I have a servlet that creates an instance of the Smartcloud ProfileService. When I create the first instance and it determines that authentication is required, the code properly triggers the authentication redirects to the browser, but it does not interrupt the flow of execution within the original thread and provides no feedback that the authentication flow has been triggered. There needs to be some kind of feedback to notify the currently executing code that it should exit and wait for authentication to complete.

I currently work around this by immediately checking the authentication state of the Endpoint.. e.g.

      if (service == null)
        service = new ProfileService("smartcloud");
      boolean authed = service.getEndpoint().isAuthenticated();
      if (!authed) service.getProfile(); // force authentication
      return authed;

Line four is to force the authentication step to occur prior to exiting out of the thread of execution.

This should be made more explicit... perhaps by throwing a catchable exception if authentication is required and has not yet been established... or providing a more easily accessible method to check for authentication state on the ProfileService object. e.g.

  if (service == null) 
    service = new ProfileService("smartcloud");
  if (service.authenticated()) {
    // do stuff
  }

Calling service.authenticated in the above example would trigger the authentication flow if necessary, then return false if that flow has not yet been successfully completed.. or return true immediately if authentication credentials are established.

JsonDataHandler.getAsInt doesn't work as expected

I have a JSON which looks like this:

...
"case_number": 127, 
...

As you can see, this is an integer. However when I use JsonDataHandler.getAsInt("case_number"), the result will be 0. When examining the method, that's no surprise:

    @Override
    public int getAsInt(FieldEntry field) {
        return Integer.parseInt(getAsString(field));
//      return data.getAsInt((String)field.getPath());
    }

    /**
     * @param fieldName
     * @return value as int 
     */
    @Override
    public int getAsInt(String fieldName) {
        try {
            return Integer.parseInt(getAsString(fieldName));
        } catch (NumberFormatException e) {
            return 0;
        }
    }

Why is getAsString used here and not getAsInt? It's even commented out in the first method.

Maybe this even reveals a deeper issue. The getAsString method calls JsonJavaObject.getString, which apparently returns my int as 127.0
Is it supposed to do that?

Comment not found in fetchComments()

Hi,

The comment is empty when I use the method createActivityStreamEntryObject in the Class ActivityStreamEntry. that's call fetchComments()

When I see the 'DataNavigator' in ' fetchComments', I think the problem come from :

// Before : object.get("replies").get("items");
-> solution : DataNavigator replies = object.get(0);

and to
// Before : String comment = reply.stringValue("content");
-> solution : String comment = reply.stringValue("summary");

Regards,

Oauth credentials are not being persisted to the configured database

Even though a db2 database has been created using the supplied script, a datasource set up and the necessary configuration changes made in managed-beans.xml, credentials never get saved to the database so the oauth authorization must happen for each new browser session.

Access to orgid/customerid in Smartcloud Profile Object

Unless I missed it, the Smartcloud ProfileService Profile object does not provide access to the subscriber's "Org ID" (customerid)... it only provides access to the user's id (subscriberid). The org id is required too. It needs to be made available as a property of the profile.

Also, fwiw, calling profile.get("orgId") results in a Class Cast Error going from a Double to a String.

Performance: getMyCommunities()

I want to convert a project from an Abdera implementation to the SocialSDK.

But I discoverd a real performance issue. The program based on the SocialSDK needs more than 9-10 times as the original Abdera code.
Using the SocialSDK it takes more than 50 seconds to get 104 communities. The abdera code needs 5-6 seconds.
Both are using the same Connections API:
"communities/service/atom/communities/my"

SocialSDK snippet:

CommunityService communityService = app.getCommunityService();
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("ps", "20");
parameters.put("page", page.toString());
do {
    communities = communityService.getMyCommunities(parameters);
    System.out.println(communities.getTotalResults());

    for (Community community : communities) {
        System.out.println(community.getTitle() + " " + community.getCommunityUuid());
    }
    page++;
    parameters.put("page", page.toString());
} while (communities.size() == 20);

Impossible to load SBTSDK within a Web Worker

Because of the Dojo and Jquery dependency, it is currently not possible to load the library javascript within a javascript Web Worker... Errors are thrown within Dojo and Jquery.

It is possible to workaround using a non-default dojo configuration and a bit of hacking but that's not optimum.

The method to rename the community break the mechanism of hereditary father-son

The method to rename the community:

(y.getTitle().equalsIgnoreCase("TestPrincipale"))
{
y.setTitle("EJB" + tempEsprinetOrganization);
y.save();
...

break the mechanism of hereditary father-son community, breaking all communities. We need a save method that correctly perpetual inheritance of the community to solve this issue.
The production environment of the customer (Esprinet) is waiting for this fix and there are a lot of pressure from the business.

http://infolib.lotus.com/resources/social_business_toolkit/javadoc/com/ibm/sbt/services/client/connections/communities/Community.html

Thank's
Michela

OAuth2Handler: finally implementation of "content.close();"

content.close();

in the finally block must be more safe

Currently
} finally {
content.close();
}

Needed
} finally {
if(content != null)
content.close();
}

Motivation: I got a NullPointerException instead of the real SSLPeerUnverifiedException

null pointer exception in base service when using SSOEndpoint

getMyCommunities (java) fails with a null pointer exception when using the SSOEndpoint

java.lang.NullPointerException
at com.ibm.sbt.services.client.base.BaseService.retrieveData(BaseService.java:351)
at com.ibm.sbt.services.client.base.BaseService.retrieveData(BaseService.java:372)
at com.ibm.sbt.services.client.base.BaseService.retrieveData(BaseService.java:325)
at com.ibm.sbt.services.client.base.BaseService.getEntities(BaseService.java:185)
at com.ibm.sbt.services.client.connections.communities.CommunityService.getMyCommunities(CommunityService.java:259)
at com.ibm.sbt.services.client.connections.communities.CommunityService.getMyCommunities(CommunityService.java:243)
at com.ibm.colpal.filepublisher.FilePublisher.doGet(FilePublisher.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:307)
at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:562)
at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:255)
at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:259)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1224)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
at com.ibm.sbt.util.SBTFilter.doFilter(SBTFilter.java:53)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)
...

in this specific case there where multiple cookie token on the request as shown in the firebug detail panel

untitled

CommunityXpath is not right for Tags

https://github.com/OpenNTF/SocialSDK/blob/master/src/eclipse/plugins/com.ibm.sbt.core/src/com/ibm/sbt/services/client/connections/communities/model/CommunityXPath.java

CommunityXpath is not right. It should not return 4 tags when there are only three (as highlighted below)

Tag1:community
Tag2:test
Tag3:test2
Tag4:test3

The Tags should not return the community tag, when using
String communityUuid = "4aa94a1a-8710-4abf-ac63-b6a0c3d1e930";
Community community = communityService.getCommunity(communityUuid);

    /*
     * Gets the current details of the Community
     */
     out.println(community.getTitle());
     out.println("<br/>");

     List<String> tags = community.getTags();
     int tagCount = 1; 
     for(String tag : tags){
        out.println("Tag" + tagCount++ + ":" + tag);
        out.println("<br/>");
     }

This means that when I update I should get 4 tags instead of the 3.

Thanks

paul

  1. snx:communityUuid4aa94a1a-8710-4abf-ac63-b6a0c3d1e930/snx:communityUuid

  2. http://communities.ibm.com:2006/service/atom/community/instance?communityUuid=4aa94a1a-8710-4abf-ac63-b6a0c3d1e930

  3. <title type="text">Test</title>
  4. snx:membercount1/snx:membercount

  5. snx:communityTypeprivate/snx:communityType

  6. snx:handle

  7. /snx:handle

  8. snx:preModerationfalse/snx:preModeration

  9. snx:postModerationfalse/snx:postModeration

  10. 2013-09-23T20:30:44.743Z

  11. 2013-10-22T16:45:19.526Z

  12. <p dir="ltr">&nbsp;</p>

  13.  
  14. <name>Paul Bastide</name>
    
  15. snx:userid20089096/snx:userid
    
  16. snx:userStateactive/snx:userState
    
  17. <snx:orgId type="text">20085940/snx:orgId
    
  18. <name>Paul Bastide</name>
    
  19. snx:userid20089096/snx:userid
    
  20. snx:userStateactive/snx:userState
    
  21. <snx:orgId type="text">20085940/snx:orgId
    
  22. <snx:communityTheme snx:uuid="">

  23. /snx:communityTheme

  24. snx:communityStartPage

  25. /snx:communityStartPage

  26. snx:isExternaltrue/snx:isExternal

SEN: File indexing

We looked at the Social Business Toolkit source code, and they seem to always be setting the content type as atom+xml, which is probably the problem, since all of our files are being created through this mechanism:
headers.put("content-type", "application/atom+xml");

Issue with Chrome

Trying to send a POST request to the ActivityStream with the Javascript API on a Chrome browser (version 28.0.1500.72) returns a HTTP 403. However, the same function works when executed on Mozilla Firefox.

Script sample :

function publish(postData){
    require([ "sbt/Endpoint", "sbt/dom", "sbt/json", "sbt/config"], function(Endpoint, dom, json, config) {

        // ActivityStream URL
        var url = "/connections/opensocial/oauth/rest/activitystreams/@me/@all";

        // HTTP params
        var params = {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            data: postData
        };

        // Endpoint
        var endpoint = config.findEndpoint("connectionsOA2");
        endpoint.request(url, params).then(function(response){
            dom.setText('data', 'Success');
            console.debug(response);
        }, function(error){
            dom.setText('data', 'Error');
            console.debug(error);
        });
    });
}

HTTP Request

POST /sbt.sample.web/service/proxy/connectionsOA2/connections/opensocial/oauth/rest/activitystreams/@me/@ALL HTTP/1.1
Host: vmdev:8081
Connection: keep-alive
Content-Length: 255
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
Content-Type: application/json
Accept: /
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en,en-US;q=0.8
Cookie: JSESSIONID=5EB2E4953F6AD1646F1DD81A451DBAF2

HTTP Response

HTTP/1.1 403 Forbidden
Date: Wed, 31 Jul 2013 13:27:25 GMT
Server: IBM_HTTP_Server
X-Powered-By: Servlet/3.0
X-LConn-Auth: true
X-UA-Compatible: IE=EmulateIE7
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Cache-Control: no-cache="set-cookie, set-cookie2"
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Language: en-US
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked

IBM SBT SDK: Represent Community Widgets as Java objects

I cannot find any representation (as a Java class) of Community Widgets as general objects.

There should be added support ("someone should implement...") for Community Widgets management to the IBM SBT SDK for Java, like there is support for other entities like Communities, Forums, Blogs...

Starting from "community.getWidgets()", a general Widget type would be required. Depending on the actual widgetDefId, a collection of entries of that type should be available, like "Forums", "Files" etc.

The operations described at http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Community_widgets_feed_ic45&content=pdcontent should be available in a reasonable way, i. e. things like "community.addWidget(widgetDefId)", "community.getWidget(widgetInstanceId)", "community.getWidgets(widgetDefId, ...)", "community.hideWidget(widgetInstanceId)" etc. should be implemented.

ProfileService.load Loading Wrong Profile

When attempting to load a profile for a specific user id, the ProfileService.load method is instead returning the profile of the authenticated user.

If you look specifically at [1], lines 137 and 140, you'll note that the user id parameter is never set. And the method calls the ProfilesAPIMap.GETPROFILE URL, which is hard coded to "/lotuslive-shindig-server/social/rest/people/@me/@self".

This makes the ProfileService class unusable for retrieving profile details for anyone other than the authenticated user.

[1] https://github.com/OpenNTF/SocialSDK/blob/master/src/eclipse/plugins/com.ibm.sbt.core/src/com/ibm/sbt/services/client/smartcloud/profiles/ProfileService.java

NoClassDefFound Error from SBT Java Applications

The following piece of code for a standalone Java application normally works. In case we provide a wrong password, it will throw an uncatchable NoClassDefFoundError with the stack trace below...

ClientService.processResponse gets an error code (404) from the remote server. In this case, it doesn't fail, instead, tries to redirect user to the login page. However, since it's a standalone application, there is no servlet context. It fails with an uncatchable error and developer has no chance to recover the application in case of a wrong password.

I'm using this for a background application where username/password is pre-configured and such a failure will result in an unstable environment.

In case of a standalone application, redirection would be canceled or better, a way to test authentication within the endpoint would be fantastic!

Thanks.

RuntimeFactory runtimeFactory=null;
Application application=null;
Context context = null;

try {
    runtimeFactory=new RuntimeFactoryStandalone();
    application=runtimeFactory.initApplication(null);
    context = Context.init(application, null, null);

    ConnectionsBasicEndpoint endpoint= new ConnectionsBasicEndpoint();

    endpoint.setUrl("https://connectionserver.com");
    endpoint.setForceTrustSSLCertificate(true);
    endpoint.login("someuser", "somepassword"); // password is wrong

    System.out.println(endpoint.isAuthenticated());

    ProfileService ps=new ProfileService(endpoint);

    Profile me=ps.getMyProfile();

    System.out.println(me.getName());
} catch(Throwable t) {
    t.printStackTrace();
} finally {
    if (context != null)
        Context.destroy(context);
    if (application != null)
        Application.destroy(application);
}

Trace:

java.lang.NoClassDefFoundError: javax.servlet.http.HttpServletRequest
at com.ibm.commons.runtime.Context.getHttpRequest(Context.java:115)
at com.ibm.sbt.services.endpoints.BasicEndpoint.authenticate(BasicEndpoint.java:151)
at com.ibm.sbt.services.client.ClientService.forceAuthentication(ClientService.java:296)
at com.ibm.sbt.services.client.ClientService.processResponse(ClientService.java:1154)
at com.ibm.sbt.services.client.ClientService._xhr(ClientService.java:1072)
at com.ibm.sbt.services.client.ClientService.execRequest(ClientService.java:1037)
at com.ibm.sbt.services.client.ClientService.xhr(ClientService.java:997)
at com.ibm.sbt.services.client.ClientService.get(ClientService.java:873)
at com.ibm.sbt.services.client.ClientService.get(ClientService.java:869)
at com.ibm.sbt.services.client.ClientService.get(ClientService.java:859)
at com.ibm.sbt.services.client.ClientService.get(ClientService.java:846)
at com.ibm.sbt.services.client.connections.profiles.ProfileService.getMyUserId(ProfileService.java:805)
at com.ibm.sbt.services.client.connections.profiles.ProfileService.getMyProfile(ProfileService.java:824)
at testing.Test01.main(Test01.java:34)

Need method to get all invitations for a community

Viewing community invitations in the Connections UI, there's a "Feed for Invitations" link that gets all invitations for a single community.
It uses a path like /communities/service/atom/community/invites?communityUuid=[communityUuid]

Please add a method to CommunityService and/or Community in the SBT API to retrieve this feed as an InviteList.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.