[Building Sakai] Set Site Page Position

Steve Swinsburg steve.swinsburg at gmail.com
Thu Nov 7 12:30:55 PST 2013


I think you are thinking of custom titles where you need to not only set
the title, but also the flag (seems redundant, the setting of the custom
title should also set the flag if its necessary).

Anyway, the setPosition should work on its own. Here is a snippet directly
from the web service call to add a page to a site:

Site siteEdit = null;

SitePage sitePageEdit = null;

siteEdit = siteService.getSite(siteid);

sitePageEdit = siteEdit.addPage();

sitePageEdit.setTitle(pagetitle);

sitePageEdit.setLayout(pagelayout);


//KNL-250, SAK-16819 - if position too large, will throw
ArrayIndexOutOfBoundsException

//deal with this here and just set to the number of pages - 1 so its at the
bottom.

int numPages = siteEdit.getPages().size();

if(position > numPages) {

position = numPages-1;

}


sitePageEdit.setPosition(position);

sitePageEdit.setPopup(popup);

siteService.save(siteEdit);


On Fri, Nov 8, 2013 at 3:05 AM, Charles Severance <csev at umich.edu> wrote:

> Something in the back of my mind says that you need to enable custom order
> as well.
>
> /Chuck
>
> On Nov 6, 2013, at 11:54 PM, Paul Mungai <paulwando at gmail.com> wrote:
>
> Any Leads?
>
>
> On Wed, Nov 6, 2013 at 12:37 PM, Paul Mungai <paulwando at gmail.com> wrote:
>
>> Hi,
>>
>> Using the SitePage Api "org.sakaiproject.site.api.SitePage",
>> setPosition() doesn't work - atleast in my context.
>>
>> Other SitePage methods work perfectly.
>>
>> Any leads?
>>
>> --
>> Regards,
>> Paul Mungai
>>
>>
>
>
> --
> Regards,
> Paul Mungai
>
>
>
> _______________________________________________
> 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"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20131108/48d70a8e/attachment.html 


More information about the sakai-dev mailing list