[opencms-dev] How to add a new resource type

M Butcher mbutcher at grcomputing.net
Fri Feb 27 08:37:00 CET 2004


I know this thread is a little old, but I'm working on my resource type.

Emilio wrote about the rules_key stuff in the /system/workplace/restype 
files a while back. I've done a little bit of work on this, now, and I 
think I can fill in some gaps. This is based largely on the code in 
/system/workplace/scripts/explorer.js

Emilio wrote:
> Hi,
> 
>  > "rules_key(d d aaai dddd dddd dddd dddd)"
> 
> a Active
Shows up in the popup menu and is active.
> i Inactive
Shows up in the popup menu, but is grayed-out (inactive)
> d Desactive
Does not show up in the popup menu.

> 
> and the bits....
> 
> 1 - online state
> 2 - don't know
2 (nearly always 'd') appears to be the state when a resource exists 
only in Online, but you are working in Offline. The only menu item that 
seems to use this explicitely is "Copy to project", which I've never 
seen because I've never seen a file in Online that didn't also exist in 
Offline.

Here, I'm going to try and rephrase what Emilio said, filling in info on 
the last few segments of rules.

In each of the 5 groups of keys (aaai, dddd, dddd, dddd) the positions 
correspond to this four states:
0 - not modified
1 - modified
2 - new
3 - deleted

Now, the five groups correspond to various publishing states, where 
three things are considered: lock owner, lock state, and project.

1 (aaai): resource is unlocked
2 (dddd): resource is locked by the current user in the current project
3 (dddd): resource is locked by another user in the current project
4 (dddd): resource is locked by current user in a different project
5 (dddd): resource is locked by another user in a different project

I hope that makes sense. Now, if only I could think of a reason to apply 
my new-found knowledge!

Emilio, thanks for getting me started down the right path. I never would 
have figured this out myself.

Matt



More information about the opencms-dev mailing list