[Building Sakai] how to entends Site object...

John Bush john.bush at rsmart.com
Wed Jun 15 22:02:02 PDT 2011


any Entity is sakai has properties, basically you can attach meta data
of any sort.  Think of it as a custom field if you like.  So you
probably don't need that extra table

//to add
site.getProperties().addProperty("sponser, sponser)

//to access
site.getProperties().get("sponsor")

these show up in the sakai_site_property table in the database


2011/6/15  <swwangl at tsmc.com>:
>
>
> Dear John:
>   we have another table to store addition site information. e.g: site
> category, site sponser, etc... )
> I have to access the additional table by foreign key "Site.getId" to get
> these fields.
> So, I want to put these fields into "Site" object for future JSF or VM use.
>
> Or could you give me some ideas to use site properties to acheive the same
> purpose?
>
>
> Best Regards,
> Joan
>
>
>
>
> |------------------------------------->
> |            John Bush                |
> |            <john.bush at rsmart.com>   |
> |                                     |
> |                                     |
> |                                     |
> |            06/16/2011 11:39 AM      |
> |------------------------------------->
>  >--------------------------------------------------------------------------------------------------------------------------------------------------|
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                To|
>  |        swwangl at tsmc.com                                                                                                                          |
>  |                                                                                                                                                cc|
>  |        sakai-dev at collab.sakaiproject.org                                                                                                         |
>  |                                                                                                                                           Subject|
>  |        Re: [Building Sakai] how to entends Site object...                                                                                        |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  >--------------------------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
> what are you trying to add exactly, perhaps using site properties
> might be a less forky way of achiveing the same result.
>
> On Wed, Jun 15, 2011 at 8:37 PM,  <swwangl at tsmc.com> wrote:
>>
>> We want more additional fields for "Site" object.
>> So, I write a object to extends "BaseSite" object.
>> After get "Site" oject, we want to new a "NewSite" object to extends
>> "Site". and then set the additional fields for "NewSite".
>> But I have no idea to construct the BaseSiteService. could anyone have
>> experience?
>>
>>
>> ===api from kernel1.2.1 java docs===
>> BaseSite(BaseSiteService siteService, Site other)
>> ? ? ?Construct from another Site, exact.
>> =================================
>>
>> my program:
>> List<Site> sites =SiteService.getSites(xxxx,xxx,xx,xxx...
>> for (Site site : sites) {
>> ? ?NewBaseSite new_site=new NewBaseSite(baseSiteService, site);
>> ? ?...
>> }
>>
>> but I can't get baseSiteService instance to construct NewBaseSite
>> successfully
>>
>> Could anyone provide some suggestion?
>>
>>
>>
>> Best Regards,
>> Joan
>>
>>
>>
> ---------------------------------------------------------------------------
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TSMC PROPERTY
>> ?This email communication (and any attachments) is proprietary
> information
>> ?for the sole use of its
>> ?intended recipient. Any unauthorized review, use or distribution by
> anyone
>> ?other than the intended
>> ?recipient is strictly prohibited. ?If you are not the intended
> recipient,
>> ?please notify the sender by
>> ?replying to this email, and then delete this email and any copies of it
>> ?immediately. Thank you.
>>
> ---------------------------------------------------------------------------
>>
>>
>>
>>
>> _______________________________________________
>> 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"
>>
>
>
>
> --
> John Bush
> 602-490-0470
>
>
>  ---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>  ---------------------------------------------------------------------------
>
>
>
>



-- 
John Bush
602-490-0470


More information about the sakai-dev mailing list