You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by JohnBrown <mi...@softasap.net> on 2008/01/09 23:49:37 UTC

Some API to Edit controller.xml?

Hi Guys,

I am in process of making more intuitive UI and some automation over
standard ofbiz CMS for creating FAQ, Policy and alike pages. The process
involves adding some entries ( a reference to page and the view map etc.) to
controller.xml file. ANd what I would like at this point is that user just
would enter the url part he wants it to be: for example
host.com:8080/ecommerce/MyFAQPage and there would be generated respective
entries in controller.xml behind the scene - with no need for user to edit
the file manually.
something like:

  <request-map uri="MyFAQPage"> 
  <security https="false" auth="false"/> 
  <response name="success" type="view" value="FAQ"/> 
 </request-map> 
..and the view map.

So I wonder does Ofbiz has something already within the packages which could
help me to add such kind of entries to controller.xml via java code? Perhaps
some xml file editor api classes?

Thank you guys in advance for any hints.
-- 
View this message in context: http://www.nabble.com/Some-API-to-Edit-controller.xml--tp14723536p14723536.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: User Interface to Edit controller.xml?

Posted by JohnBrown <mi...@softasap.net>.
Hi Phanndra,

MYFAQ page in my case is going to be a page which consists of several parts
- header, footer and left nav bar which I think will be ftl templates and
the 4th part is actually the content entered via cms.
So I see it this way - at the time of request the page is built by including
header, footer and left navbar and retrieving content from cms. The same
structure will be used for other pages like about us, contacts etc - 3
elements - header, footer and navbar left unchanged but content from cms
will be varying depending on page.


G.Venkata Phanindra wrote:
> 
> Hi All,
>           I would like to know is the page MYFAQ is a static page or a
> dynamic page. Ifs its a static page we can always use the content
> management
> module to show that page as any other content page like about us only
> thing
> we need to do is have a request wrapper that internally sends a url which
> will send the actual url to the ofbiz.
> 
> I think this will reduce the number of entries into controller.xml
> 
> Regards
> 
> Phanndra.
> 
> 
> 
> On Jan 10, 2008 8:05 AM, BJ Freeman <bj...@free-man.net> wrote:
> 
>> I only sent one of these
>> not sure how two got here
>>
>>
>> BJ Freeman sent the following on 1/9/2008 5:45 PM:
>>  > Strange.. I would change the controller but even after five minutes
>> the
>> > new info was not available. Branch 4.0
>> > not sure about trunk
>> >
>> > David E Jones sent the following on 1/9/2008 5:27 PM:
>> >> It can definitely be changed on the fly and the cache cleared (or by
>> >> default in dev mode the cache is cleared every 10 seconds anyway, or
>> >> rather cache lines expire after 10 seconds).
>> >>
>> >> The better approach for dynamic URLs like this is definitely the CMS
>> >> stuff though, like Adrian mentioned. There are some pretty good tools
>> >> and examples for this that come OOTB. Just search for "cms" in the
>> >> controller.xml file in the ecommerce component.
>> >>
>> >> -David
>> >>
>> >>
>> >> On Jan 9, 2008, at 6:19 PM, BJ Freeman wrote:
>> >>
>> >>> Thanks scott.
>> >>> Guess I missed how to un-cache them.
>> >>> I always have to reboot.
>> >>>
>> >>>
>> >>> Scott Gray sent the following on 1/9/2008 4:17 PM:
>> >>>> On 10/01/2008, BJ Freeman <bj...@free-man.net> wrote:
>> >>>>> The controller, at this point, is loaded once at boot up.
>> >>>>>
>> >>>>
>> >>>> No it's not, I regularly put new entries in the controller at run
>> >>>> time and
>> >>>> they are available straight away.  It may be cached, I'm not sure,
>> >>>> but they
>> >>>> definitely aren't just loaded during startup.
>> >>>>
>> >>>> Regards
>> >>>> Scott
>> >>>>
>> >
>> >
>> >
>> >
>>
>>
> 
> 
> -- 
> G.Venkata Phanindra
> Mob:: 9849852989
> 
> 

-- 
View this message in context: http://www.nabble.com/Some-API-to-Edit-controller.xml--tp14723536p14740372.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: User Interface to Edit controller.xml?

Posted by "G.Venkata Phanindra" <ph...@gmail.com>.
Hi All,
          I would like to know is the page MYFAQ is a static page or a
dynamic page. Ifs its a static page we can always use the content management
module to show that page as any other content page like about us only thing
we need to do is have a request wrapper that internally sends a url which
will send the actual url to the ofbiz.

I think this will reduce the number of entries into controller.xml

Regards

Phanndra.



On Jan 10, 2008 8:05 AM, BJ Freeman <bj...@free-man.net> wrote:

> I only sent one of these
> not sure how two got here
>
>
> BJ Freeman sent the following on 1/9/2008 5:45 PM:
>  > Strange.. I would change the controller but even after five minutes the
> > new info was not available. Branch 4.0
> > not sure about trunk
> >
> > David E Jones sent the following on 1/9/2008 5:27 PM:
> >> It can definitely be changed on the fly and the cache cleared (or by
> >> default in dev mode the cache is cleared every 10 seconds anyway, or
> >> rather cache lines expire after 10 seconds).
> >>
> >> The better approach for dynamic URLs like this is definitely the CMS
> >> stuff though, like Adrian mentioned. There are some pretty good tools
> >> and examples for this that come OOTB. Just search for "cms" in the
> >> controller.xml file in the ecommerce component.
> >>
> >> -David
> >>
> >>
> >> On Jan 9, 2008, at 6:19 PM, BJ Freeman wrote:
> >>
> >>> Thanks scott.
> >>> Guess I missed how to un-cache them.
> >>> I always have to reboot.
> >>>
> >>>
> >>> Scott Gray sent the following on 1/9/2008 4:17 PM:
> >>>> On 10/01/2008, BJ Freeman <bj...@free-man.net> wrote:
> >>>>> The controller, at this point, is loaded once at boot up.
> >>>>>
> >>>>
> >>>> No it's not, I regularly put new entries in the controller at run
> >>>> time and
> >>>> they are available straight away.  It may be cached, I'm not sure,
> >>>> but they
> >>>> definitely aren't just loaded during startup.
> >>>>
> >>>> Regards
> >>>> Scott
> >>>>
> >
> >
> >
> >
>
>


-- 
G.Venkata Phanindra
Mob:: 9849852989

Re: User Interface to Edit controller.xml?

Posted by BJ Freeman <bj...@free-man.net>.
I only sent one of these
not sure how two got here


BJ Freeman sent the following on 1/9/2008 5:45 PM:
> Strange.. I would change the controller but even after five minutes the
> new info was not available. Branch 4.0
> not sure about trunk
> 
> David E Jones sent the following on 1/9/2008 5:27 PM:
>> It can definitely be changed on the fly and the cache cleared (or by
>> default in dev mode the cache is cleared every 10 seconds anyway, or
>> rather cache lines expire after 10 seconds).
>>
>> The better approach for dynamic URLs like this is definitely the CMS
>> stuff though, like Adrian mentioned. There are some pretty good tools
>> and examples for this that come OOTB. Just search for "cms" in the
>> controller.xml file in the ecommerce component.
>>
>> -David
>>
>>
>> On Jan 9, 2008, at 6:19 PM, BJ Freeman wrote:
>>
>>> Thanks scott.
>>> Guess I missed how to un-cache them.
>>> I always have to reboot.
>>>
>>>
>>> Scott Gray sent the following on 1/9/2008 4:17 PM:
>>>> On 10/01/2008, BJ Freeman <bj...@free-man.net> wrote:
>>>>> The controller, at this point, is loaded once at boot up.
>>>>>
>>>>
>>>> No it's not, I regularly put new entries in the controller at run
>>>> time and
>>>> they are available straight away.  It may be cached, I'm not sure,
>>>> but they
>>>> definitely aren't just loaded during startup.
>>>>
>>>> Regards
>>>> Scott
>>>>
> 
> 
> 
> 


Re: User Interface to Edit controller.xml?

Posted by BJ Freeman <bj...@free-man.net>.
Strange.. I would change the controller but even after five minutes the
new info was not available. Branch 4.0
not sure about trunk

David E Jones sent the following on 1/9/2008 5:27 PM:
> 
> It can definitely be changed on the fly and the cache cleared (or by
> default in dev mode the cache is cleared every 10 seconds anyway, or
> rather cache lines expire after 10 seconds).
> 
> The better approach for dynamic URLs like this is definitely the CMS
> stuff though, like Adrian mentioned. There are some pretty good tools
> and examples for this that come OOTB. Just search for "cms" in the
> controller.xml file in the ecommerce component.
> 
> -David
> 
> 
> On Jan 9, 2008, at 6:19 PM, BJ Freeman wrote:
> 
>> Thanks scott.
>> Guess I missed how to un-cache them.
>> I always have to reboot.
>>
>>
>> Scott Gray sent the following on 1/9/2008 4:17 PM:
>>> On 10/01/2008, BJ Freeman <bj...@free-man.net> wrote:
>>>> The controller, at this point, is loaded once at boot up.
>>>>
>>>
>>>
>>> No it's not, I regularly put new entries in the controller at run
>>> time and
>>> they are available straight away.  It may be cached, I'm not sure,
>>> but they
>>> definitely aren't just loaded during startup.
>>>
>>> Regards
>>> Scott
>>>
>>
> 


Re: User Interface to Edit controller.xml?

Posted by David E Jones <jo...@hotwaxmedia.com>.
It can definitely be changed on the fly and the cache cleared (or by  
default in dev mode the cache is cleared every 10 seconds anyway, or  
rather cache lines expire after 10 seconds).

The better approach for dynamic URLs like this is definitely the CMS  
stuff though, like Adrian mentioned. There are some pretty good tools  
and examples for this that come OOTB. Just search for "cms" in the  
controller.xml file in the ecommerce component.

-David


On Jan 9, 2008, at 6:19 PM, BJ Freeman wrote:

> Thanks scott.
> Guess I missed how to un-cache them.
> I always have to reboot.
>
>
> Scott Gray sent the following on 1/9/2008 4:17 PM:
>> On 10/01/2008, BJ Freeman <bj...@free-man.net> wrote:
>>> The controller, at this point, is loaded once at boot up.
>>>
>>
>>
>> No it's not, I regularly put new entries in the controller at run  
>> time and
>> they are available straight away.  It may be cached, I'm not sure,  
>> but they
>> definitely aren't just loaded during startup.
>>
>> Regards
>> Scott
>>
>


Re: User Interface to Edit controller.xml?

Posted by BJ Freeman <bj...@free-man.net>.
Thanks scott.
Guess I missed how to un-cache them.
I always have to reboot.


Scott Gray sent the following on 1/9/2008 4:17 PM:
> On 10/01/2008, BJ Freeman <bj...@free-man.net> wrote:
>> The controller, at this point, is loaded once at boot up.
>>
> 
> 
> No it's not, I regularly put new entries in the controller at run time and
> they are available straight away.  It may be cached, I'm not sure, but they
> definitely aren't just loaded during startup.
> 
> Regards
> Scott
> 


Re: User Interface to Edit controller.xml?

Posted by Scott Gray <le...@gmail.com>.
On 10/01/2008, BJ Freeman <bj...@free-man.net> wrote:
>
> The controller, at this point, is loaded once at boot up.
>


No it's not, I regularly put new entries in the controller at run time and
they are available straight away.  It may be cached, I'm not sure, but they
definitely aren't just loaded during startup.

Regards
Scott

Re: Content Manager Question (was: User Interface to Edit controller.xml?)

Posted by Adrian Crum <ad...@hlmksw.com>.
 From what I understand, the Content Manager enables the user to create as many web pages as they 
want - without the need to modify controller.xml files. I gave this thread a more accurate subject 
line - let's see if it helps bring in informed answers.

-Adrian

JohnBrown wrote:

> Thank you for reply. Well, I can add ( pre-define) URLS/MAPS to conroller in
> design  time for some standard pages but it works unless they want to add  a
> new custom page with some URL/MAP which is not in controller. And this is
> where I need programmatically add the entry in runtime. Because, the content
> admin person will just get lost in raw xml editing and quit possible can
> make syntax error there etc.
> 
> On my opinion this would be a useful thing to automate in the terms of
> user-friendly content management.
> 
> 
> BJ Freeman wrote:
> 
>>The controller, at this point, is loaded once at boot up.
>>you can write an enhanced xml editor that reads the xsd for fields in a
>>form, similar to how the widgets read the entities to display info.
>>But non of this has been done, to my knowledge.
>>Just a note, view map must follow all the request-maps or you get an
>>error on loading.
>>my thought it would better to have all these in the Controller on
>>distribution then they can just edit the FAQ page as HTML in the Content
>>application.
>>
>>JohnBrown sent the following on 1/9/2008 2:47 PM:
>>
>>>Hi Guys,
>>>
>>>I am in process of making more intuitive UI and some automation over
>>>standard ofbiz CMS for creating FAQ, Policy and alike pages. The process
>>>involves adding some entries ( a reference to page and the view map etc.)
>>>to
>>>controller.xml file. ANd what I would like at this point is that user
>>>just
>>>would enter the url part he wants it to be: for example
>>>host.com:8080/ecommerce/MyFAQPage and there would be generated respective
>>>entries in controller.xml behind the scene - with no need for user to
>>>edit
>>>the file manually.
>>>something like:
>>>
>>>  <request-map uri="MyFAQPage"> 
>>>  <security https="false" auth="false"/> 
>>>  <response name="success" type="view" value="FAQ"/> 
>>> </request-map> 
>>>..and the view map.
>>>
>>>So I wonder does Ofbiz has something already within the packages which
>>>could
>>>help me to add such kind of entries to controller.xml via java code?
>>>Perhaps
>>>some xml file editor api classes?
>>>
>>>Thank you guys in advance for any hints.
>>
>>
>>
> 
> 


Re: User Interface to Edit controller.xml?

Posted by JohnBrown <mi...@softasap.net>.
Thank you for reply. Well, I can add ( pre-define) URLS/MAPS to conroller in
design  time for some standard pages but it works unless they want to add  a
new custom page with some URL/MAP which is not in controller. And this is
where I need programmatically add the entry in runtime. Because, the content
admin person will just get lost in raw xml editing and quit possible can
make syntax error there etc.

On my opinion this would be a useful thing to automate in the terms of
user-friendly content management.


BJ Freeman wrote:
> 
> The controller, at this point, is loaded once at boot up.
> you can write an enhanced xml editor that reads the xsd for fields in a
> form, similar to how the widgets read the entities to display info.
> But non of this has been done, to my knowledge.
> Just a note, view map must follow all the request-maps or you get an
> error on loading.
> my thought it would better to have all these in the Controller on
> distribution then they can just edit the FAQ page as HTML in the Content
> application.
> 
> JohnBrown sent the following on 1/9/2008 2:47 PM:
>> Hi Guys,
>> 
>> I am in process of making more intuitive UI and some automation over
>> standard ofbiz CMS for creating FAQ, Policy and alike pages. The process
>> involves adding some entries ( a reference to page and the view map etc.)
>> to
>> controller.xml file. ANd what I would like at this point is that user
>> just
>> would enter the url part he wants it to be: for example
>> host.com:8080/ecommerce/MyFAQPage and there would be generated respective
>> entries in controller.xml behind the scene - with no need for user to
>> edit
>> the file manually.
>> something like:
>> 
>>   <request-map uri="MyFAQPage"> 
>>   <security https="false" auth="false"/> 
>>   <response name="success" type="view" value="FAQ"/> 
>>  </request-map> 
>> ..and the view map.
>> 
>> So I wonder does Ofbiz has something already within the packages which
>> could
>> help me to add such kind of entries to controller.xml via java code?
>> Perhaps
>> some xml file editor api classes?
>> 
>> Thank you guys in advance for any hints.
> 
> 
> 


-- 
View this message in context: http://www.nabble.com/Some-API-to-Edit-controller.xml--tp14723536p14724653.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: User Interface to Edit controller.xml?

Posted by BJ Freeman <bj...@free-man.net>.
The controller, at this point, is loaded once at boot up.
you can write an enhanced xml editor that reads the xsd for fields in a
form, similar to how the widgets read the entities to display info.
But non of this has been done, to my knowledge.
Just a note, view map must follow all the request-maps or you get an
error on loading.
my thought it would better to have all these in the Controller on
distribution then they can just edit the FAQ page as HTML in the Content
application.

JohnBrown sent the following on 1/9/2008 2:47 PM:
> Hi Guys,
> 
> I am in process of making more intuitive UI and some automation over
> standard ofbiz CMS for creating FAQ, Policy and alike pages. The process
> involves adding some entries ( a reference to page and the view map etc.) to
> controller.xml file. ANd what I would like at this point is that user just
> would enter the url part he wants it to be: for example
> host.com:8080/ecommerce/MyFAQPage and there would be generated respective
> entries in controller.xml behind the scene - with no need for user to edit
> the file manually.
> something like:
> 
>   <request-map uri="MyFAQPage"> 
>   <security https="false" auth="false"/> 
>   <response name="success" type="view" value="FAQ"/> 
>  </request-map> 
> ..and the view map.
> 
> So I wonder does Ofbiz has something already within the packages which could
> help me to add such kind of entries to controller.xml via java code? Perhaps
> some xml file editor api classes?
> 
> Thank you guys in advance for any hints.