[Building Sakai] Resource Tool Database

Jim Eng jimeng at umich.edu
Tue Mar 10 07:15:48 PDT 2009


The patterns I mentioned yesterday could give you what you are asking  
for.  For example, to get the files in dropboxes:

select resources_id, in_collection, context, file_path, file_size from  
content_resource where resource_id like '/group-user/%';

But the data you harvest in this way is devoid of other information  
that is crucial to the integrity of the Content Hosting Service.  For  
example, going around the API's in this way would open dangerous  
security holes if access to that information is allowed through those  
indexes without sakai permissions checks.

You might ask Ian Boston about this.  He implemented sakai's search  
service, which indexes resources and other sakai entities as they are  
created by accessing sakai events.  That might be a safer way to build  
the indexes you need.

HTH.

Jim


Quoting Iuliana <iulianas at gmail.com>:

> Hi Jim...
>
> We are trying to index some contents through api
> called "Terrier" from resources content. To index the content we need
> separate the content tools and then send the information from CONTENT_table
> to terrier index. Because of this the content
> need to be separeted, because, when the research happen I need know where
> they are coming. Sorry for my English.
>
> Example:
> A file document of resources have expecific columns
> resources_id, in_collection, context, file_path, file_size.
> We need some query which give us values of this columns of all
> document file inside resources table stored between yesterday
> and today, for the purpose index some files, once a day.
>
> Do you undestand now?
> I hope yes...(laugh)
>
> Best wish.
> iuliana.
>
>
> On Mon, Mar 9, 2009 at 6:01 PM, Jim Eng <jimeng at umich.edu> wrote:
>
>> Hi Iuliana,
>>
>> I still do not understand what you want to accomplish.
>>
>> We strongly recommend against making changes in the data for ContentHosting
>> by direct access through the database.  I will give you the SQL that
>> provides a count of the number of files in dropboxes, in workspace sites,
>> and in other sites, but trying to use SQL to access records for individual
>> files (or the contents of those files) is not a good idea.  That is likely
>> to lead to corruption of your data and instability of your system.  If there
>> is some specific problem you are trying to solve, it would probably be
>> better to discuss that problem on sakai-dev or sakai-production to see if
>> someone has some advice.
>>
>> Here are the queries to get counts of records, using MySQL syntax:
>>
>> For DROPBOX:
>> select count(*) from content_resource where resource_id like
>> '/group-user/%';
>>
>> For WORKSPACE sites:
>> select count(*) from content_resource where resource_id like '/user/%';
>>
>> For other sites (Course sites and Project sites):
>> select count(*) from content_resource where resource_id like '/group/%';
>>
>> Because these queries use a 'like' operator, they are likely to be slow.
>>  They would not be recommended for use on a production system with large
>> numbers of resources.
>>
>> Jim
>>
>>
>> On Mar 9, 2009, at 3:58 PM, Iuliana wrote:
>>
>> Jim, only remmenber...
>> Still desperate...
>>
>> ---------- Forwarded message ----------
>> From: Iuliana <iulianas at gmail.com>
>> Date: Mon, Mar 9, 2009 at 8:51 AM
>> Subject: Re: Reaource Tool Database
>> To: Jim Eng <jimeng at umich.edu>
>>
>>
>> Hi Jim, thanks for the answer...
>>
>> Maybe I do not have explain so good.
>>
>> I need especifically one "select" clause...
>> One select where I can take the information about
>> Dropbox tool and another select where I can take
>> the information about Resources Tool.
>>
>> For example:
>> "SELECT id, in_collection, context, file_path, file_size, date FROM
>> CONTENT_RESOUCE WHERE toolid='resources'", And them I will have the
>> resources tool information.
>>
>> "SELECT id, in_collection, context, file_path, file_size, date FROM
>> CONTENT_RESOUCE WHEREwhere toolid='dropbox'", And them I will have the
>> dropbox tool information.
>>
>> I'm following your recommendation. I'm not putting
>> tools in separeted tables.
>>
>> Best wishes,
>> iuliana.
>>
>>
>> On Fri, Mar 6, 2009 at 4:11 PM, Jim Eng <jimeng at umich.edu> wrote:
>>
>>> Hi Luliana,
>>> I'm not understanding exactly what you are trying to accomplish. Can you
>>> give me more detail?
>>>
>>> Dropbox and Resources are implemented in the same service.  They do have
>>> different resource-id's though.  Resources and folders in dropboxes have
>>> id's that start with "/group-user/", resources and folders in MyWorkspace
>>> have id's that start with "/user/", and items in other kinds of sites
>>> (course sites and project sites) have id's that start with "/group/".  Is
>>> this what you are looking for?
>>>
>>> I would not recommend putting them in separate tables, if that is what you
>>> are suggesting.  The code for storing and retrieving resource info  
>>> is pretty
>>> complex.
>>>
>>> Jim
>>>
>>>
>>>
>>> On Mar 6, 2009, at 1:51 PM, Iuliana wrote:
>>>
>>> Hi Jim,
>>>
>>> Aaron give-me your reference in content/resources tool.
>>> I need mer or something about resources tool where I can
>>> to split resouce, dropbox, presentations and other tool who
>>> use the same CONTENT_RESOUCE table to save the resource file.
>>> Or same place at code who say where or what api can I do this.
>>>
>>> I have been examining db-api, BaseContentResouce.java and
>>> others but is so hard understand.
>>>
>>> Please help-me Jim.
>>> I'm desperate.
>>>
>>> Best wish...
>>>
>>> --
>>> Iuliana Souza
>>> System Analyst
>>> University of São Paulo - Brazil
>>> (16) 9963-9155
>>>
>>>
>>>
>>
>>
>> --
>> Iuliana Souza
>> Graduada em Análise de Sistemas
>> (16) 9963-9155
>>
>>
>>
>> --
>> Iuliana Souza
>> Graduada em Análise de Sistemas
>> (16) 9963-9155
>>
>>
>>
>
>
> --
> Iuliana Souza
> Graduada em Análise de Sistemas
> (16) 9963-9155
>



Jim Eng
jimeng at umich.edu


More information about the sakai-dev mailing list