You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Michael Wechner <mi...@wyona.com> on 2006/04/10 16:31:29 UTC

usecase-policies config path hardcoded within global-sitemap ...

Hi

I have noticed that within

http://staging.ejo.ch/lenya/ejo/authoring/index.html

the

<map:act type="resource-exists" 
src="lenya/pubs/{1}/config/ac/usecase-policies.xml">
          <map:transform type="usecasemenu"/>
        </map:act>

is hardcoded instead being read from the ac.xconf

I guess it would make sense to use an InputModule (e.g. XMLInputModule) 
for this, right?

Any suggestion?

Thanks

Michi

-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org
+41 44 272 91 61


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecase-policies config path hardcoded within global-sitemap ...

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner schrieb:

[...]

> I haven't checked how this transformers works, but in the case of the 
> menu transformer one can speed it up a lot by checking it's actually 
> needed (authoring) or not (live)

You're right, but this has to be configurable, since it cannot
be applied generally. Some publications need the usecase policies
in the live area as well (e.g., for administration tasks).


>>> I am not sure but would 
>>> ...src="fallback://lenya/config/ac/usecase-policies.xml">
>>> not do the trick?
>>
>>
>> No, the problem is, like Michi mentioned, that the config
>> file is accessed directly and not via the API. Only the
>> UsecaseAuthorizer may know where the policies are stored.
> 
> right, we should access the UsecaseAuthorizer and not the config itself 
> ... something like an UsescaseAuthorizerExistsInputModule ...

Hmmm - I wouldn't add this logic to the sitemap. The optimization
could be done by the transformer. If it doesn't want to
interfere, because no usecases are protected, then it can just
pass through the SAX events. In this case, the performance impact
would be negligible:

public void startElement(...) {
     if (usecasesAreProtected) {
         ...
     }
     else {
         super.startElement(...);
     }
}


If you think this is not sufficient, we could add the logic to the
access control module:

   <map:select type="parameter">
     <map:parameter name="parameter-selector-test"
                    value="{access-control:usecases-protected}"/>
     <map:when>
       <map:transform ... />
     </map:when>
   </map:select>


-- Andreas




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecase-policies config path hardcoded within global-sitemap ...

Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:

> Thorsten Scherler schrieb:
> 
>> El lun, 10-04-2006 a las 16:37 +0200, Michael Wechner escribió:
>>
>>> Michael Wechner wrote:
>>>
>>>> Hi
>>>>
>>>> I have noticed that within
>>>>
>>>> http://staging.ejo.ch/lenya/ejo/authoring/index.html
>>>
>>>
>>> sorry for this copy/paste error. It should read:
>>>
>>> src/webapp/global-sitemap.xmap
>>>
>>>> the
>>>>
>>>> <map:act type="resource-exists" 
>>>> src="lenya/pubs/{1}/config/ac/usecase-policies.xml">
>>>>          <map:transform type="usecasemenu"/>
>>>>        </map:act>
>>>>
>>>> is hardcoded instead being read from the ac.xconf
>>>>
>>>> I guess it would make sense to use an InputModule (e.g. 
>>>> XMLInputModule) for this, right?
> 
> 
> IMO the check could be removed. I could imagine that the performance
> gained by the action (if the file doesn't exist) is similar to the
> performance lost by the existence check ...

I haven't checked how this transformers works, but in the case of the 
menu transformer one can speed it up a lot by checking it's actually 
needed (authoring) or not (live)
> 
> 
>> I am not sure but would 
>> ...src="fallback://lenya/config/ac/usecase-policies.xml">
>> not do the trick?
> 
> 
> No, the problem is, like Michi mentioned, that the config
> file is accessed directly and not via the API. Only the
> UsecaseAuthorizer may know where the policies are stored.

right, we should access the UsecaseAuthorizer and not the config itself 
... something like an UsescaseAuthorizerExistsInputModule ...

Michi



> 
> -- Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
> 
> 


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com              http://cocoon.apache.org/lenya/
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecase-policies config path hardcoded within global-sitemap ...

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler schrieb:
> El lun, 10-04-2006 a las 16:37 +0200, Michael Wechner escribió:
>> Michael Wechner wrote:
>>
>>> Hi
>>>
>>> I have noticed that within
>>>
>>> http://staging.ejo.ch/lenya/ejo/authoring/index.html
>>
>> sorry for this copy/paste error. It should read:
>>
>> src/webapp/global-sitemap.xmap
>>
>>> the
>>>
>>> <map:act type="resource-exists" 
>>> src="lenya/pubs/{1}/config/ac/usecase-policies.xml">
>>>          <map:transform type="usecasemenu"/>
>>>        </map:act>
>>>
>>> is hardcoded instead being read from the ac.xconf
>>>
>>> I guess it would make sense to use an InputModule (e.g. 
>>> XMLInputModule) for this, right?

IMO the check could be removed. I could imagine that the performance
gained by the action (if the file doesn't exist) is similar to the
performance lost by the existence check ...


> I am not sure but would 
> ...src="fallback://lenya/config/ac/usecase-policies.xml">
> not do the trick?

No, the problem is, like Michi mentioned, that the config
file is accessed directly and not via the API. Only the
UsecaseAuthorizer may know where the policies are stored.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecase-policies config path hardcoded within global-sitemap ...

Posted by Michael Wechner <mi...@wyona.com>.
Thorsten Scherler wrote:

>
>
>
>I am not sure but would 
>...src="fallback://lenya/config/ac/usecase-policies.xml">
>not do the trick?
>  
>

no, because this path needs to be configured within ac.xconf resp. 
local.ac.xconf

Michi

>salu2
>  
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org
+41 44 272 91 61


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecase-policies config path hardcoded within global-sitemap ...

Posted by Thorsten Scherler <th...@apache.org>.
El lun, 10-04-2006 a las 16:37 +0200, Michael Wechner escribió:
> Michael Wechner wrote:
> 
> > Hi
> >
> > I have noticed that within
> >
> > http://staging.ejo.ch/lenya/ejo/authoring/index.html
> 
> 
> sorry for this copy/paste error. It should read:
> 
> src/webapp/global-sitemap.xmap
> 
> >
> > the
> >
> > <map:act type="resource-exists" 
> > src="lenya/pubs/{1}/config/ac/usecase-policies.xml">
> >          <map:transform type="usecasemenu"/>
> >        </map:act>
> >
> > is hardcoded instead being read from the ac.xconf
> >
> > I guess it would make sense to use an InputModule (e.g. 
> > XMLInputModule) for this, right?
> >
> > Any suggestion?
> >

I am not sure but would 
...src="fallback://lenya/config/ac/usecase-policies.xml">
not do the trick?

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecase-policies config path hardcoded within global-sitemap ...

Posted by Michael Wechner <mi...@wyona.com>.
Michael Wechner wrote:

> Hi
>
> I have noticed that within
>
> http://staging.ejo.ch/lenya/ejo/authoring/index.html


sorry for this copy/paste error. It should read:

src/webapp/global-sitemap.xmap

>
> the
>
> <map:act type="resource-exists" 
> src="lenya/pubs/{1}/config/ac/usecase-policies.xml">
>          <map:transform type="usecasemenu"/>
>        </map:act>
>
> is hardcoded instead being read from the ac.xconf
>
> I guess it would make sense to use an InputModule (e.g. 
> XMLInputModule) for this, right?
>
> Any suggestion?
>
> Thanks
>
> Michi
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org
+41 44 272 91 61


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org