You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Paloma Gomez <pa...@gmail.com> on 2006/06/25 21:39:31 UTC

Lenya 1.4: CMS menus and new module framework

Hi everyone,

I did a fresh checkout yesterday and I have noticed that the way of
creating modules has changed. So I'm trying to adapt the module I'm
working on to fit with the new implementation.

I've added a new module.xml file to my module and I've changed my
menu.xsp file like this:
[code]
[...]
 <menu i18n:attr="name" name="Edit">
          <xsp:logic>
            try {
                Object doc = <input:get-attribute
module="page-envelope" as="object" name="document"/>;
                if (doc instanceof Document &amp;&amp; ((Document)
doc).exists()) {
                    String doctype = <input:get-attribute
module="page-envelope" as="string" name="document-type"/>;
                    if ("eventcalendar".equals(doctype)) {
                        <block info="false">

                          <item wf:event="edit"
uc:usecase="edit.eventcalendar" href="?"><i18n:text>With
Eventcalendar</i18n:text></item>

                        </block>
                    }
                }
            }
            catch (Exception e) {
                throw new ProcessingException("Error during menu
generation: ", e);
            }
          </xsp:logic>
      </menu>
[/code]

The menu entry "With eventcalendar" keeps displaying greyed. I know
that there's a file called usecase-policies in the default publication
which lists all the available usecases and I think that my usecase
should also be listed there. I would like how to configure it so that
it is  listed as the others. Thanks.

Regards,

Paloma
--
Paloma Gomez

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


Re: Lenya 1.4: CMS menus and new module framework

Posted by Joern Nettingsmeier <po...@uni-due.de>.
Andreas Hartmann wrote:
> Jörn Nettingsmeier wrote:
>> Paloma Gomez wrote:
>>> Hi Jörn,
>>>
>>>> try adding
>>>> <usecase id="edit.eventcalendar">
>>>>      <role id="admin"/>
>>>>      <role id="editor"/>
>>>> </usecase>
>>>> to <yourpub>/config/ac/usecase-policies.xml, or (if you inherit this
>>>> file) to your template publication.
>>>
>>> Thanks for your answer. I knew that might work, however I thought this
>>> list was somehow generated automatically because of the following
>>> comment at the beginning of the default/config/ac/usecase-policies.xml
>>> file:
>>>
>>> [code]
>>> <!--+++NOTE+++ The usecase list was initialized using
>>> modules/usecase-impl/xslt/initUsecasePolicies.xsl.-->
>>> [/code]
>>>
>>> So, the only way of configuring it is doing it manually, isn't it?
>>
>> it is generated automatically during build,
> 
> No, ATM you have to generate it manually.

ah, sorry, misunderstanding on my part.


-- 
"Án nýrra verka, án nútimans, hættir fortíðin að vekja áhuga."
"Without new works, without the present the past will cease to be of
interest."
        - Ásmundur Sveinsson (1893-1982)

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736


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


Re: Lenya 1.4: CMS menus and new module framework

Posted by Paloma Gomez <pa...@gmail.com>.
Hi Andreas,

Thanks, that makes things clearer.

Regards,
Paloma

2006/6/26, Andreas Hartmann <an...@apache.org>:
> Jörn Nettingsmeier wrote:
> > Paloma Gomez wrote:
> >> Hi Jörn,
> >>
> >>> try adding
> >>> <usecase id="edit.eventcalendar">
> >>>      <role id="admin"/>
> >>>      <role id="editor"/>
> >>> </usecase>
> >>> to <yourpub>/config/ac/usecase-policies.xml, or (if you inherit this
> >>> file) to your template publication.
> >>
> >> Thanks for your answer. I knew that might work, however I thought this
> >> list was somehow generated automatically because of the following
> >> comment at the beginning of the default/config/ac/usecase-policies.xml
> >> file:
> >>
> >> [code]
> >> <!--+++NOTE+++ The usecase list was initialized using
> >> modules/usecase-impl/xslt/initUsecasePolicies.xsl.-->
> >> [/code]
> >>
> >> So, the only way of configuring it is doing it manually, isn't it?
> >
> > it is generated automatically during build,
>
> No, ATM you have to generate it manually.
>
> > but currently only with
> > "admin" roles. in order to make the cms usable for non-admins, you have
> > to tweak it manually.
> >
> > but you are right, if your module registers a usecase in cocoon.xconf,
> > there should be an automatic entry for admin at least. maybe there's a
> > bug, the whole thing is very new.
>
> See above - but maybe we need a better solution for this.
>
> -- Andreas
>
>
>
> --
> Andreas Hartmann
> Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
> http://www.wyona.com                      http://lenya.apache.org
> andreas.hartmann@wyona.com                     andreas@apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>

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


Re: Lenya 1.4: CMS menus and new module framework

Posted by Andreas Hartmann <an...@apache.org>.
Jörn Nettingsmeier wrote:
> Paloma Gomez wrote:
>> Hi Jörn,
>>
>>> try adding
>>> <usecase id="edit.eventcalendar">
>>>      <role id="admin"/>
>>>      <role id="editor"/>
>>> </usecase>
>>> to <yourpub>/config/ac/usecase-policies.xml, or (if you inherit this
>>> file) to your template publication.
>>
>> Thanks for your answer. I knew that might work, however I thought this
>> list was somehow generated automatically because of the following
>> comment at the beginning of the default/config/ac/usecase-policies.xml
>> file:
>>
>> [code]
>> <!--+++NOTE+++ The usecase list was initialized using
>> modules/usecase-impl/xslt/initUsecasePolicies.xsl.-->
>> [/code]
>>
>> So, the only way of configuring it is doing it manually, isn't it?
> 
> it is generated automatically during build,

No, ATM you have to generate it manually.

> but currently only with 
> "admin" roles. in order to make the cms usable for non-admins, you have 
> to tweak it manually.
> 
> but you are right, if your module registers a usecase in cocoon.xconf, 
> there should be an automatic entry for admin at least. maybe there's a 
> bug, the whole thing is very new.

See above - but maybe we need a better solution for this.

-- Andreas



-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


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


Re: Lenya 1.4: CMS menus and new module framework

Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Paloma Gomez wrote:
> Hi Jörn,
> 
>> try adding
>> <usecase id="edit.eventcalendar">
>>      <role id="admin"/>
>>      <role id="editor"/>
>> </usecase>
>> to <yourpub>/config/ac/usecase-policies.xml, or (if you inherit this
>> file) to your template publication.
> 
> Thanks for your answer. I knew that might work, however I thought this
> list was somehow generated automatically because of the following
> comment at the beginning of the default/config/ac/usecase-policies.xml
> file:
> 
> [code]
> <!--+++NOTE+++ The usecase list was initialized using
> modules/usecase-impl/xslt/initUsecasePolicies.xsl.-->
> [/code]
> 
> So, the only way of configuring it is doing it manually, isn't it?

it is generated automatically during build, but currently only with 
"admin" roles. in order to make the cms usable for non-admins, you have 
to tweak it manually.

but you are right, if your module registers a usecase in cocoon.xconf, 
there should be an automatic entry for admin at least. maybe there's a 
bug, the whole thing is very new.

-- 
"Open source takes the bullshit out of software."
	- Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736

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


Re: Lenya 1.4: CMS menus and new module framework

Posted by Paloma Gomez <pa...@gmail.com>.
Hi Jörn,

> try adding
> <usecase id="edit.eventcalendar">
>      <role id="admin"/>
>      <role id="editor"/>
> </usecase>
> to <yourpub>/config/ac/usecase-policies.xml, or (if you inherit this
> file) to your template publication.

Thanks for your answer. I knew that might work, however I thought this
list was somehow generated automatically because of the following
comment at the beginning of the default/config/ac/usecase-policies.xml
file:

[code]
<!--+++NOTE+++ The usecase list was initialized using
modules/usecase-impl/xslt/initUsecasePolicies.xsl.-->
[/code]

So, the only way of configuring it is doing it manually, isn't it?

Thanks

Regards,
Paloma
--
Paloma Gomez

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


Re: Lenya 1.4: CMS menus and new module framework

Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Paloma Gomez wrote:
> Hi everyone,
> 
> I did a fresh checkout yesterday and I have noticed that the way of
> creating modules has changed. So I'm trying to adapt the module I'm
> working on to fit with the new implementation.
> 
> I've added a new module.xml file to my module and I've changed my
> menu.xsp file like this:
> [code]
> [...]
> <menu i18n:attr="name" name="Edit">
>          <xsp:logic>
>            try {
>                Object doc = <input:get-attribute
> module="page-envelope" as="object" name="document"/>;
>                if (doc instanceof Document &amp;&amp; ((Document)
> doc).exists()) {
>                    String doctype = <input:get-attribute
> module="page-envelope" as="string" name="document-type"/>;
>                    if ("eventcalendar".equals(doctype)) {
>                        <block info="false">
> 
>                          <item wf:event="edit"
> uc:usecase="edit.eventcalendar" href="?"><i18n:text>With
> Eventcalendar</i18n:text></item>
> 
>                        </block>
>                    }
>                }
>            }
>            catch (Exception e) {
>                throw new ProcessingException("Error during menu
> generation: ", e);
>            }
>          </xsp:logic>
>      </menu>
> [/code]
> 
> The menu entry "With eventcalendar" keeps displaying greyed. I know
> that there's a file called usecase-policies in the default publication
> which lists all the available usecases and I think that my usecase
> should also be listed there. I would like how to configure it so that
> it is  listed as the others. Thanks.

check the tooltip when you hover your mouse over the menu - if it says 
"access denied", then it is indeed a usecase policy problem.

the default usecase policy has been changed to "deny" a few days, ago, 
i.e. if you don't specify a policy for a usecase, you can't use it.

try adding
<usecase id="edit.eventcalendar">
     <role id="admin"/>
     <role id="editor"/>
</usecase>
to <yourpub>/config/ac/usecase-policies.xml, or (if you inherit this 
file) to your template publication.

of course, the name of the usecase must be the name you chose in your 
config/cocoon-xconf/*.xconf file.


best,

jörn




-- 
"Open source takes the bullshit out of software."
	- Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736

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