[Building Sakai] Sakai 2.9 Entity Providers
Aaron Zeckoski
azeckoski at unicon.net
Fri Jun 21 05:19:28 PDT 2013
Paul,
Is there somewhere I can try your code out?
AutoRegister only works when something is a component but since that
would appear to be the case I am guessing something else is going on.
-AZ
On Fri, Jun 21, 2013 at 8:09 AM, Paul Wando Mungai <paulwando at gmail.com> wrote:
> I have written the following provider (which was working well in 2.8),
> however, it doesnt seem to be registered. No errors are thrown. It module
> gets deployed correctly in tomcat/components.
>
> ------------------------------------------------/Code starts
> here/----------------------------------------------------
>
> public class WitsEAddToolsToSiteEntityProviderImpl extends
> AbstractEntityProvider implements CoreEntityProvider,
> AutoRegisterEntityProvider, ActionsExecutable, RESTful {
>
> private SiteService siteService;
> public final static String ENTITY_PREFIX = "addsitetools";
> //private CourseCreatorUtils courseCreatorUtils;
> private UserDirectoryService userDirectoryService;
> private ToolManager toolManager;
> private static ResourceLoader rb = new ResourceLoader("addsitetools");
> private EntityBrokerManager entityBrokerManager;
>
>
> @Autowired
> public void setSiteService(SiteService siteService) {
> this.siteService = siteService;
> }
>
> public void setEntityBrokerManager(EntityBrokerManager
> entityBrokerManager) {
> this.entityBrokerManager = entityBrokerManager;
> }
>
> @Autowired
> public void setUserDirectoryService(UserDirectoryService
> userDirectoryService) {
> this.userDirectoryService = userDirectoryService;
> }
>
> @Autowired
> public void setToolManager(ToolManager toolManager){
> this.toolManager = toolManager;
> }
> /*
> @Autowired
> public void setCourseCreatorUtils(CourseCreatorUtils
> courseCreatorUtils){
> this.courseCreatorUtils = new CourseCreatorUtils(siteService,
> userDirectoryService, toolManager);
>
> }*/
>
> @Override
> public String getEntityPrefix() {
> return ENTITY_PREFIX;
> }
>
> @Override
> public boolean entityExists(String string) {
> return true;
> }
>
> @Override
> public String createEntity(EntityReference er, Object o, Map<String,
> Object> map) {
> //return "addsitetools create entity";
> return null;
> }
>
> @Override
> public Object getSampleEntity() {
> return "addsitetools sample entity";
> }
>
> @Override
> public void updateEntity(EntityReference er, Object o, Map<String,
> Object> map) {
> System.out.println("addsitetools entity updated");
> }
>
> @Override
> public Object getEntity(EntityReference er) {
> return "addsitetools entity";
> }
>
> @Override
> public void deleteEntity(EntityReference er, Map<String, Object> map) {
> System.out.println("addsitetools entity deleted");
> }
>
> /**
> * site/siteId
> */
> @EntityCustomAction(action = "site", viewKey = EntityView.VIEW_LIST)
> public List<SiteTool> addSiteTools(EntityView view, Map<String, Object>
> params) {
>
> //get siteId
> String siteId = view.getPathSegment(2);
>
> List<SiteTool> siteTools = courseCreatorUtils.addSiteTools(siteId);
>
> return siteTools;
> }
>
> @Override
> public String[] getHandledOutputFormats() {
> return new String[]{Formats.XML, Formats.JSON, Formats.FORM};
> }
>
> @Override
> public String[] getHandledInputFormats() {
> return new String[]{Formats.HTML, Formats.XML, Formats.JSON};
> }
>
> @Override
> public List<?> getEntities(EntityReference er, Search search) {
> return null;
> }
> }
>
> ------------------------------------------------/Code ends
> here/----------------------------------------------------
> --
> Regards,
> Paul Mungai
>
> "Ability is what youre capable of doing. Motivation determines what you do.
> Attitude determines how well you do it" By Lou Holtz, Notre Dame Football
> Coach
>
> _______________________________________________
> 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"
--
Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile
More information about the sakai-dev
mailing list