exo-social

Can't publish an activity for a space created in socialdemo by opensocial API

Details

  • BV:
    0
  • Labels:
  • Similar issues:
    SOC-630 Publish update on edit profile
  • Description:
    Hide

    Because of the problem of cache in GateIn, I changed my application to use socialdemo instead of portal.

    Publishing an activity to a space created in portal is working.
    Publishing an activity to a space created in socialdemo is not working.

    To reproduce:

    • start from a clean exo social
    • create a space in socialdemo
    • publish an activity using the opensocial API
    • go to the space, the activity is not visible, but in the log, there is sign that the activity has been stored somewhere:
      I get Jul 2, 2010 3:39:21 PM org.exoplatform.social.core.activitystream.ActivityStorage save
      INFO: storing activity for owner space:Sugar Cases 4 by 92186e90c0a8026456c4395505117bad
      Jul 2, 2010 3:39:30 PM org.exoplatform.portal.application.PortalSessionListener onSessionCreated
      INFO: portal' portal

    Doing the same thing but with the portal "portal" is working.

    Show
    Because of the problem of cache in GateIn, I changed my application to use socialdemo instead of portal. Publishing an activity to a space created in portal is working. Publishing an activity to a space created in socialdemo is not working. To reproduce:
    • start from a clean exo social
    • create a space in socialdemo
    • publish an activity using the opensocial API
    • go to the space, the activity is not visible, but in the log, there is sign that the activity has been stored somewhere:
      I get Jul 2, 2010 3:39:21 PM org.exoplatform.social.core.activitystream.ActivityStorage save
      INFO: storing activity for owner space:Sugar Cases 4 by 92186e90c0a8026456c4395505117bad
      Jul 2, 2010 3:39:30 PM org.exoplatform.portal.application.PortalSessionListener onSessionCreated
      INFO: portal' portal
    Doing the same thing but with the portal "portal" is working.
  • Environment:

    opensocial

Activity

Hide
Vi Quoc Hanh added a comment - 06/Jul/10 2:28 AM

I checked this bug, publishing an activity to a space created in socialdemo is not working. The root cause is when creating activity using the OpenSocial API the current portal container is 'portal' not 'socialdemo' so maybe activity is saved in 'portal' not in 'socialdemo', as a result we can't get published activity in socialdemo. We must find the way to get the right container when excuting createActivity method in ExoActivityService.

Show
Vi Quoc Hanh added a comment - 06/Jul/10 2:28 AM I checked this bug, publishing an activity to a space created in socialdemo is not working. The root cause is when creating activity using the OpenSocial API the current portal container is 'portal' not 'socialdemo' so maybe activity is saved in 'portal' not in 'socialdemo', as a result we can't get published activity in socialdemo. We must find the way to get the right container when excuting createActivity method in ExoActivityService.
Hide
jeremi joslin added a comment - 07/Jul/10 4:35 AM

Did you find a solution?

Show
jeremi joslin added a comment - 07/Jul/10 4:35 AM Did you find a solution?
Hide
Hoat Le added a comment - 07/Jul/10 8:29 AM

The best way is to generate OAuth security token containing our container information like our security token for gadget.

BlobCrypter crypter = getBlobCrypter(this.containerKey);
ExoBlobCrypterSecurityToken t = new ExoBlobCrypterSecurityToken(crypter, container, (String)null);
t.setAppUrl(gadgetURL);
t.setModuleId(moduleId);
t.setOwnerId(owner);
t.setViewerId(viewer);
t.setTrustedJson("trusted");
String portalContainer = PortalContainer.getCurrentPortalContainerName();
PortalRequestContext portalRequestContext = Util.getPortalRequestContext();
String url = portalRequestContext.getRequest().getRequestURL().toString();
String hostName = url.substring(0, url.indexOf(portalRequestContext.getRequestContextPath()));
t.setPortalContainer(portalContainer);
t.setHostName(hostName);
return t.encrypt();

Unfortunately, we does not have OAuth UI to manage this (to create, store right OAuth, not like hard-coded OAuth token configuration in xml).

For fast fix, we should provide a portlet to generate OAuth token containing information of the portal container; then paste this token into xml configuration.

Show
Hoat Le added a comment - 07/Jul/10 8:29 AM The best way is to generate OAuth security token containing our container information like our security token for gadget. BlobCrypter crypter = getBlobCrypter(this.containerKey); ExoBlobCrypterSecurityToken t = new ExoBlobCrypterSecurityToken(crypter, container, (String)null); t.setAppUrl(gadgetURL); t.setModuleId(moduleId); t.setOwnerId(owner); t.setViewerId(viewer); t.setTrustedJson("trusted"); String portalContainer = PortalContainer.getCurrentPortalContainerName(); PortalRequestContext portalRequestContext = Util.getPortalRequestContext(); String url = portalRequestContext.getRequest().getRequestURL().toString(); String hostName = url.substring(0, url.indexOf(portalRequestContext.getRequestContextPath())); t.setPortalContainer(portalContainer); t.setHostName(hostName); return t.encrypt(); Unfortunately, we does not have OAuth UI to manage this (to create, store right OAuth, not like hard-coded OAuth token configuration in xml). For fast fix, we should provide a portlet to generate OAuth token containing information of the portal container; then paste this token into xml configuration.
Hide
jeremi joslin added a comment - 07/Jul/10 9:26 AM

Since we add the configuration in one of the portal :
gatetin/conf/portal/configuration.xml
or
gatetin/conf/socialdemo/configuration.xml

The token is supposed to be attached to one of the portal, isn't it?

Can it help?

Show
jeremi joslin added a comment - 07/Jul/10 9:26 AM Since we add the configuration in one of the portal : gatetin/conf/portal/configuration.xml or gatetin/conf/socialdemo/configuration.xml The token is supposed to be attached to one of the portal, isn't it? Can it help?
Hide
Nguyen Trong Nghia added a comment - 13/Jul/10 10:35 AM

Hi, Jeremi
I checked configuration options and found that we only need attach the token into one configuration file(gatetin/conf/portal/configuration.xml), configuring for the second configuration file(gatetin/conf/socialdemo/configuration.xml) did not make sense.

Show
Nguyen Trong Nghia added a comment - 13/Jul/10 10:35 AM Hi, Jeremi I checked configuration options and found that we only need attach the token into one configuration file(gatetin/conf/portal/configuration.xml), configuring for the second configuration file(gatetin/conf/socialdemo/configuration.xml) did not make sense.
Hide
jeremi joslin added a comment - 14/Jul/10 3:20 AM

And so do you have a solution ?

Show
jeremi joslin added a comment - 14/Jul/10 3:20 AM And so do you have a solution ?
Hide
Hudson added a comment - 14/Jul/10 7:40 AM

Integrated in social-1.0.x-ci #35
SOC-969 Can't publish an activity for a space created in socialdemo by opensocial API

hanh_vi : 49319
Files :

  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoSocialApiGuiceModule.java
  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoOAuthAuthenticationHandler.java
  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/spi/ExoService.java
  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoAuthenticationHandlerProvider.java
Show
Hudson added a comment - 14/Jul/10 7:40 AM Integrated in social-1.0.x-ci #35 SOC-969 Can't publish an activity for a space created in socialdemo by opensocial API hanh_vi : 49319 Files :
  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoSocialApiGuiceModule.java
  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoOAuthAuthenticationHandler.java
  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/spi/ExoService.java
  • /social/branches/1.0.x/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoAuthenticationHandlerProvider.java
Hide
Hudson added a comment - 23/Jul/10 8:52 AM

Integrated in social-trunk-ci #1447
SOC-969 | can't publish an activity for a space created in socialdemo

hoat_le : 49665
Files :

  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/service/ExoService.java
  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoSocialApiGuiceModule.java
  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/auth/ExoOAuthAuthenticationHandler.java
  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/auth/ExoAuthenticationHandlerProvider.java
  • /social/trunk/component/opensocial/pom.xml
Show
Hudson added a comment - 23/Jul/10 8:52 AM Integrated in social-trunk-ci #1447 SOC-969 | can't publish an activity for a space created in socialdemo hoat_le : 49665 Files :
  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/service/ExoService.java
  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/ExoSocialApiGuiceModule.java
  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/auth/ExoOAuthAuthenticationHandler.java
  • /social/trunk/component/opensocial/src/main/java/org/exoplatform/social/opensocial/auth/ExoAuthenticationHandlerProvider.java
  • /social/trunk/component/opensocial/pom.xml

People

Dates

  • Created:
    02/Jul/10 8:02 AM
    Updated:
    27/Jul/10 2:55 AM
    Resolved:
    26/Jul/10 11:22 AM
    Date of First Response:
    06/Jul/10 2:28 AM