[Building Sakai] Injection in JSF Managed Bean

Gautham gautham at sankhya.net
Tue Mar 1 01:41:46 PST 2011


Hi,

Sakai App Builder builds the tool that uses  User Directory Service and Site
Service directly and one call the methods of User Directory Service and Site
Service in the classes.

If you are using Sakai Appbuilder0.8.8, then for better understanding take
"FULL CRUD" option and see the classes.

Please look into my below question if you can answer:

I am trying to use the Samigo API Service "import
org.sakaiproject.tool.assessment.shared.api.assessment.AssessmentServiceAPI;"
in "ExternalLogicImpl.java"(  to use Samigo methods in my new tool developed
by Sakai App Builder. I am getting the below Build Error:

[INFO] Compiling 5 source files to
D:\WS-Sakai\DBTESTMAIN\impl\target\classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
D:\WS-Sakai\DBTESTMAIN\impl\src\java\org\sakaiproject\dbtestmain\logic\ExternalL
ogicImpl.java:[29,61] package
org.sakaiproject.tool.assessment.shared.api.assess
ment does not exist


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 minute 13 seconds
[INFO] Finished at: Tue Mar 01 10:37:14 IST 2011
[INFO] Final Memory: 26M/247M
[INFO]
------------------------------------------------------------------------
D:\WS-Sakai\DBTESTMAIN>

I have learnt that I have to import APIs of the respective tools to use in
our Sakai Tool. The Sakai App builder uses all below services Successfully
and get their methods:

import org.sakaiproject.authz.api.FunctionManager;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.site.api.Site;
import org.sakaiproject.site.api.SiteService;
import org.sakaiproject.tool.api.SessionManager;
import org.sakaiproject.tool.api.ToolManager;
import org.sakaiproject.user.api.UserDirectoryService;

Does I need to import any more imports to use Samigo API Service?

Any help will be highly appreciated. 

Regards,
Gautham


50600822 at stu.hcmut.edu.vn wrote:
> 
> Hi, when I used SakaiAppBuilder to create a JSF HelloWorld, I looked at
> the faces-config and saw:
>     <managed-bean>
>         <description>Jsfdemo Tool: HelloWorld Bean</description>
>         <managed-bean-name>HelloWorldBean</managed-bean-name>
>        
> <managed-bean-class>org.sakaiproject.jsfdemo.tool.jsf.HelloWorldBean</managed-bean-class>
>         <managed-bean-scope>session</managed-bean-scope>
>         <managed-property>
>             <description>User Directory Service</description>
>             <property-name>userDirectoryService</property-name>
>            
> <value>#{org_sakaiproject_user_api_UserDirectoryService}</value>
>         </managed-property>
>     </managed-bean>
> 
> First, I thought org_sakaiproject_user_api_UserDirectoryService was a bean
> id created by Spring then injected here. But when I looked at the
> applicationContext.xml , it's empty, no such bean was declared there. I
> deployed the tool and to my suprise, it worked fine. Can somebody tell me
> what happened? What kind of context that
> org_sakaiproject_user_api_UserDirectoryService belongs to ? is it shared
> across all web app? How did that context was created (I tried but still
> don't understand how Sakai shared components work <x_x>  )? How do I get a
> list of beans in that context just in case I want to inject some useful
> bean like SessionFactory for Hibernate.
> 
> Sorry for asking too much :P
> 
> Thanks in advance.
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
> 
> 

-- 
View this message in context: http://old.nabble.com/-Building-Sakai--Injection-in-JSF-Managed-Bean-tp31039032p31039282.html
Sent from the Sakai - Development mailing list archive at Nabble.com.



More information about the sakai-dev mailing list