You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Oliver Schalch <ol...@wyona.com> on 2006/06/20 15:25:58 UTC

GUIManager & preconditions in a usecase (Assets..)

Hi Devs, 

I've made a static method into the ServletHelper Class which checks if 
enebale-upload is true or false in web.xml. So far it works as it should but, 
if upload is set to false the "Asset" Tab in the Sitearea isnt visible.

Assets.java:
...
    protected void doCheckPreconditions() throws Exception {    
        if (!ServletHelper.isUploadEnabled(manager)) {
            addErrorMessage("Upload is not enabled please check l.b.p!");
        }
    }
....

Because the preconditions wont run successfully if enable-upload is false; the 
GUIManager wont show the Tab for the Assets.

How would I solve this, overriding another Method in the Asset usecase or do I 
have to enhance the GUIManager?


Ty for any help,
Oliver



-- 
Oliver Schalch                           oliver.schalch@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

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


Re: GUIManager & preconditions in a usecase (Assets..)

Posted by Josias Thöny <jo...@wyona.com>.
Hi Oli,

On Tue, 2006-06-20 at 15:25 +0200, Oliver Schalch wrote:
> Hi Devs, 
> 
> I've made a static method into the ServletHelper Class which checks if 
> enebale-upload is true or false in web.xml. So far it works as it should but, 
> if upload is set to false the "Asset" Tab in the Sitearea isnt visible.
> 
> Assets.java:
> ...
>     protected void doCheckPreconditions() throws Exception {    
>         if (!ServletHelper.isUploadEnabled(manager)) {
>             addErrorMessage("Upload is not enabled please check l.b.p!");
>         }
>     }
> ....
> 
> Because the preconditions wont run successfully if enable-upload is false; the 
> GUIManager wont show the Tab for the Assets.
> 
> How would I solve this, overriding another Method in the Asset usecase or do I 
> have to enhance the GUIManager?

I fixed the problem by replacing addErrorMessage by addInfoMessage. The
tab should now be displayed, would you like to test?
BTW, thanks Oli for this feature, it really helps the users who wonder
why the upload was not working...

Josias

> 
> 
> Ty for any help,
> Oliver
> 
> 
> 


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