[dev] Share locking
    Chuck Hagenbuch 
    chuck at horde.org
       
    Thu Oct 23 18:20:30 UTC 2008
    
    
  
Quoting Alfonso Marín Marín <almarin at um.es>:
> As a previous step to start with CalDAV implementation, it is  
> necessary to implement Kronolith locking capabilities, to have a way  
> to lock calendars and/or events. I discussed with Jan an Ben the  
> best way to do it and we come to the conclusion that share library  
> would be a nice place to implement it to don't duplicate effort,  
> because others application could use it.
Sounds good to me.
> I have done it and i would like to know your opinion. I attach the  
> Horde_Share class modification and the Kronolith's api modification  
> to expose locking capabilities to other applications/entities.
Looks generally good. I would remove "share" from the names of methods  
that are on the share class, and the patch for kronolith/lib/api.php  
repeats _kronolith_unlock instead of implementing  
_kronolith_checklocks. And _unlock doesn't seem to use its parameters  
correctly. Oh, and there's no permissions checking.
> Some things to comment:
>  - I have implemented the methods in Horde_Share. I had some doubts  
> if it would be better in Horde_Share_Object.
I think that would be better; most individual actions are on the share  
objects now.
>  - A lock can be placed for an entire share or for an item_uid  
> associated to it.
>  - For share locks i use the $_app var as the scope and share_id as  
> the principal
>  - For item locks, i use the $_app:share_id as the scope and  
> item_uid as  the principal. to give to a share a way to know which  
> associated items are locked.
>  - It is not necessary at all use $_app information, but i thought  
> that would be good idea to have that information somewhere in the  
> lock information.
I agree.
Thanks,
-chuck
    
    
More information about the dev
mailing list