[Building Sakai] EntityCustomAction problems

Adrian Fish a.fish at lancaster.ac.uk
Wed Jan 20 04:29:30 PST 2010


Does anybody have a working example of a VIEW_NEW EntityCustomAction 
that accepts posted data? The code below throws a RuntimeException thus:

WARN Direct request failure: RuntimeException:Fatal error trying to 
execute custom action method: create:new:create:Direct request failure: 
RuntimeException:Fatal error trying to execute custom action method: 
create:new:create:

@EntityCustomAction(action="create",viewKey=EntityView.VIEW_NEW)
    public boolean create(EntityReference ref, Map<String, Object> params) {

        try
        {
        String title = (String) params.get("title");
        String description = (String) params.get("description");

        LOG.debug("Title: " + title);
        LOG.debug("Description: " + description);


        Placement placement = toolManager.getCurrentPlacement();
        String siteId = placement.getContext();

        try {
            
chatManager.createNewChannel(siteId,title,false,true,placement.getId());
            return true;
        } catch(PermissionException pe) {
            throw new SecurityException("You do not have permission to 
create channels");
        } catch(Exception e) {
            LOG.error("Failed to create channel",e);
            return false;
        }
        }
        catch(Throwable t)
        {
            System.err.println("WHOOPS! ");
            t.printStackTrace();
            return false;
        }
    }


Cheers,

Adrian.

-- 
==================================
Adrian Fish
Software Engineer
Centre for e-Science
Bowland Tower South C Floor
Lancaster University
Lancaster
LA1 4YW
email: a.fish at lancaster.ac.uk

http://confluence.sakaiproject.org/display/YAFT/Yaft
http://confluence.sakaiproject.org/display/BLOG/Home
http://confluence.sakaiproject.org/display/AGORA/Home

-------------- next part --------------
A non-text attachment was scrubbed...
Name: a_fish.vcf
Type: text/x-vcard
Size: 289 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100120/392cfaa4/attachment.vcf 


More information about the sakai-dev mailing list