[Building Sakai] what methods to get all course site ids ?

David Horwitz david.horwitz at uct.ac.za
Tue Oct 6 04:49:44 PDT 2009


Hi,

I keep forgetting Site extends AuthzGroup so you should be able to:

Site site = siteService.getSite(id);
site.setProviderGroupId(eid);
siteService.save(site);


Regards

David



Ishtiaq Ahmad wrote:
> yes i m facing the same issue that u stated.... can you elaborate it with
> sample code...
> thanks
>
> On Tue, Oct 6, 2009 at 4:09 PM, David Horwitz <david.horwitz at uct.ac.za>wrote:
>
>   
>>  Hi
>>
>> Thant records a requsted classlist - it will not actulay give the users
>> members access to the site. Iif you class is mam100_09 you will see:
>>
>> classlists: mam100_09 (requested)
>>
>> If you add it to the provider id you will see:
>> classlists: mam100_09
>>
>> and the members will have access
>>
>> Regards
>>
>> David
>>
>> Ishtiaq Ahmad wrote:
>>
>> this can be populated with this line of code
>>
>> props.addProperty("site.cm.requested", eid);
>> eid is your section Enterprise ID in CM tables.
>>
>>
>> thanks
>>
>> On Tue, Oct 6, 2009 at 3:49 PM, Nuno Fernandes <nuno at ufp.edu.pt> <nuno at ufp.edu.pt> wrote:
>>
>>
>>
>>  Nope - this one I don't know. Maybe it's related with the CM Api (or it's
>> just another site property)...
>> I am sure others can jump in and help you with this one!
>>
>> Nuno
>>
>> 2009/10/6 Ishtiaq Ahmad <organic.ishtiaq at gmail.com> <organic.ishtiaq at gmail.com>
>>
>>      Thanks this is working for me...and I am able to add term there...
>>
>> can you tell me how can i attached roster with site..? (Roster(s) with
>> site access?
>> PFA:Roster with site access.JPG
>>
>>  On Tue, Oct 6, 2009 at 2:14 PM, Nuno Fernandes <nuno at ufp.edu.pt> <nuno at ufp.edu.pt> wrote:
>>
>>
>>
>>  Hi Ishtiaq,
>> Having a *org.sakaiproject.site.api.Site* instance (and a *
>> org.sakaiproject.site.api.SiteService* instance), you can grab its
>> properties, set the term property and save the site:
>>
>> Site siteEdit = ...
>> String courseTerm = "September 2009";
>> ResourcePropertiesEdit props = siteEdit.getPropertiesEdit();
>> props.addProperty("term", courseTerm);
>> siteService.save(siteEdit);
>>
>> Hope it helps,
>> Nuno
>>
>>
>> 2009/10/6 Ishtiaq Ahmad <organic.ishtiaq at gmail.com> <organic.ishtiaq at gmail.com>
>>
>> Hi,
>>
>>
>>  I have successfully create a site using SiteService..some value are
>> missing right now... e.g. Term value... how can i add a term description
>> with site...plz refer to screen shot..
>>
>> thanks.
>> Ishtiaq Ahmad
>>
>>
>>
>> On Fri, Oct 2, 2009 at 1:22 PM, Steve Swinsburg <steve.swinsburg at gmail.com> wrote:
>>
>>
>>
>>  You've got it a bit mixed up. The site.cover.SiteService is static, so
>> you don't need to setup the private instances. Get rid of those and just use
>> SiteService.someMethod rather than siteService.
>>
>> You really should abstract this out into a logic layer though.
>> And use Spring to get your dependencies from the proper api package,
>> not the covers.
>>
>> Check out the Sakai App Builder plugin for Eclipse and generate a tool
>> - have a look at the logic layer and how its injected via Spring.
>>
>> cheer,s
>> Steve
>>
>>
>> On 02/10/2009, at 6:10 PM, Small Cat wrote:
>>
>> I hava injected the SiteService API into my app by add some lines in
>> pom.xml ( pom.xml in tool directory )
>> *
>> <dependency>
>>           <groupId>org.sakaiproject</groupId>
>>           <artifactId>sakai-site-api</artifactId>
>>  </dependency>*
>>
>> and in my java class
>>
>> *import org.sakaiproject.site.cover.SiteService;*
>> *import org.sakaiproject.site.api.*;
>> import org.sakaiproject.site.api.SiteService.SelectionType;
>> import org.sakaiproject.site.api.SiteService.SortType;
>> import org.sakaiproject.javax.PagingPosition;
>> // .....
>>
>> private SiteService siteService;
>>
>>     public void setSiteService(SiteService siteService) {
>>         this.siteService = siteService;
>>     }*
>>
>> Is it correct ?
>>
>> 2009/10/2 Steve Swinsburg <steve.swinsburg at gmail.com> <steve.swinsburg at gmail.com>
>>
>>              How have you injected the SiteService API into your app?
>> If you just dump the List directly to the command line via:
>> System.out.println("the list is: " +allCourseSites);
>>
>> what do you get? If you get null, thats the issue.
>>
>> cheers,
>> Steve
>>
>>
>>
>> On 02/10/2009, at 2:58 PM, Small Cat wrote:
>>
>> I test it, but it isn't successful :( , and i do'nt know how to fix it
>> . :(
>> this is my code in java bean
>>
>> *private SiteService siteService;
>> public void setSiteService(SiteService siteService){
>>         this.siteService = siteService;
>>     }
>> public List<Site> allCourseSites = siteService.getSites(
>> SelectionType.ACCESS, null, null, null,SortType.TITLE_ASC, null);
>> public String getOneSite(){
>>         return allCourseSites.get(0).getTitle();
>>     }*
>>
>> and this is code in .jsp file
>>
>> *<h:outputText value= " One of many sites is #{TestBean.oneSite}"/>*
>>
>> when it's run in Sakai, it show only the string " One of many sites is
>> " in  .jsp file, but don't show any site's tittle though my sakai has some
>> project site & course site ( all of them have 5-10 participants )
>>
>> Please help me fix it !
>>
>> 2009/10/1 Steve Swinsburg <steve.swinsburg at gmail.com> <steve.swinsburg at gmail.com>
>>
>>                Hi,
>>
>> yes, in SiteService, the method getSites(). Check out that Class in
>> the API docs.
>>
>> e.g. SiteService.getSites(SelectionType.ACCESS, null, null, null,
>> SortType.TITLE_ASC, null);
>>
>> cheers,
>> Steve
>>
>>
>> On 01/10/2009, at 2:34 PM, Small Cat wrote:
>>
>>
>>
>>
>>  Dear all,
>> How can I get a list of all course sites that a particular user is a
>> member of ?
>> Does Sakai suport any APIs to do this ? If yes, where can i find
>> them ?
>> Thanks and regards !
>>
>> _______________________________________________
>> sakai-dev mailing listsakai-dev at collab.sakaiproject.orghttp://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>
>> TO UNSUBSCRIBE: send email tosakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>> "unsubscribe"
>>
>>
>>
>>                                  --
>> Regards,
>> Tran Trung Kien
>>
>>
>>
>> _______________________________________________
>> sakai-dev mailing listsakai-dev at collab.sakaiproject.orghttp://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>
>> TO UNSUBSCRIBE: send email tosakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>> "unsubscribe"
>>
>>
>>
>>  --
>> Regards,
>> Ishtiaq Ahmad
>>
>> _______________________________________________
>> sakai-dev mailing listsakai-dev at collab.sakaiproject.orghttp://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>
>> TO UNSUBSCRIBE: send email tosakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>> "unsubscribe"
>>
>>
>>
>>  --
>> Nuno Fernandes  [www.linkedin.com/in/nfgrilo]
>> Analyst/Programmer - UFP-UV  [Universidade Virtual]
>> Software Developer - Sakai Foundation  [sakaiproject.org]
>> Sakai Fellow 2008 - Sakai Foundation  [confluence.sakaiproject.org/confluence/x/FIF9AQ]
>>
>> Universidade Fernando Pessoa  [www.ufp.pt]
>> Praça 9 de Abril, 349
>> 4249-004 Porto
>> tel: + 351 22 507 13 00
>> fax: + 351 22 550 82 69
>>
>>
>>
>>  --
>> Regards,
>> Ishtiaq Ahmad
>>
>>
>>
>>  --
>> Nuno Fernandes  [www.linkedin.com/in/nfgrilo]
>> Analyst/Programmer - UFP-UV  [Universidade Virtual]
>> Software Developer - Sakai Foundation  [sakaiproject.org]
>> Sakai Fellow 2008 - Sakai Foundation  [confluence.sakaiproject.org/confluence/x/FIF9AQ]
>>
>> Universidade Fernando Pessoa  [www.ufp.pt]
>> Praça 9 de Abril, 349
>> 4249-004 Porto
>> tel: + 351 22 507 13 00
>> fax: + 351 22 550 82 69
>>
>>
>>
>>    ------------------------------
>>
>> _______________________________________________
>> sakai-dev mailing listsakai-dev at collab.sakaiproject.orghttp://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/20091006/5a589e61/attachment.html 


More information about the sakai-dev mailing list