You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Bruno Busco <br...@gmail.com> on 2008/04/20 18:49:18 UTC

How to change an ecommerce .ftl file reusing the whole

Hi,
as long as I go deeper and deeper in ofbiz I can appreciate the very good
design of this application.

Now I need to make a my own eshop module and I want to be sure I am using
all the re-use mechanism you have designed.
- I have created an eshop application under the hot-deploy, here I have all
my data files using the "ext" reader, with the data file I have defined my
show, website, facilities, catalogs and categories.
- In my eshop application, I have the controller.xml file that (as seen in
ecommerce clone example) includes the ecommerce application controller with
the line
<include
location="component://ecommerce/webapp/ecommerce/WEB-INF/controller.xml"/>

- In my eshop application there is also the images folder with a modified
copy of the ecommerce.css file and all required gif

Now I need little changes in some of the .ftl files. I want not to modify
the original files of the ecommerce application so that I can better follow
the development and update without conflicts.

Is there a mechanism that let me have one or more additional .ftl files in
my application and all standard .ftl under the original ecommerce?

For example:
I have changed the minilastviewedcategories.ftl. I would like to have a
modified copy of this file in my own application.
I can create a copy in my application but in order to make ofbiz using it I
need to local copy also all the other files in the chain that are:
CatalogScreens.xml, CommonScreens.xml and the controller.xml

Could anyone make some light for me on this?

Thank you

-Bruno

Re: How to change an ecommerce .ftl file reusing the whole

Posted by Bruno Busco <br...@gmail.com>.
At the moment I have configured my controller.xml like this:

<site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="
http://ofbiz.apache.org/dtds/site-conf.xsd">
    <include
location="component://ecommerce/webapp/ecommerce/WEB-INF/controller.xml"/>
    <description>OFBiz: Cloned eCommerce Controller Configuration
File</description>

    <!-- Overloaded view-map -->
    <view-map name="main" type="screen"
page="component://eshop/widget/CommonScreens.xml#main"/>
    <view-map name="category" type="screen"
page="component://eshop/widget/CatalogScreens.xml#category"/>
</site-conf>

and it seems that the <view-map> tag overload does work!
I have not changed the ecommerce controller.xml and the main and category
requests are now served with my local CatalogScreens.xml

-Bruno

2008/4/20, Daniel Martínez <da...@paradisosistemas.es>:
>
> Guess this is a message for the user's mailing list
>
> Anyway, there goes my two cents:
> I think you already have the answer. AFAIK there is no mechanism in OfBiz
> to "overload" a request-map/view-map (which you'd need to change the
> location of the widget XML file)
>
> If I am not wrong you have two options:
>
> 1- Copy over the controller.xml file from ecommerce and make your local
> changes.
> 2- Use a different request name for your modified screen than the
> original.
>
> regards,
> --
> Daniel Martínez
>
> Bruno Busco escribió:
>
> > Hi,
> > as long as I go deeper and deeper in ofbiz I can appreciate the very
> > good
> > design of this application.
> >
> > Now I need to make a my own eshop module and I want to be sure I am
> > using
> > all the re-use mechanism you have designed.
> > - I have created an eshop application under the hot-deploy, here I have
> > all
> > my data files using the "ext" reader, with the data file I have defined
> > my
> > show, website, facilities, catalogs and categories.
> > - In my eshop application, I have the controller.xml file that (as seen
> > in
> > ecommerce clone example) includes the ecommerce application controller
> > with
> > the line
> > <include
> >
> > location="component://ecommerce/webapp/ecommerce/WEB-INF/controller.xml"/>
> >
> > - In my eshop application there is also the images folder with a
> > modified
> > copy of the ecommerce.css file and all required gif
> >
> > Now I need little changes in some of the .ftl files. I want not to
> > modify
> > the original files of the ecommerce application so that I can better
> > follow
> > the development and update without conflicts.
> >
> > Is there a mechanism that let me have one or more additional .ftl files
> > in
> > my application and all standard .ftl under the original ecommerce?
> >
> > For example:
> > I have changed the minilastviewedcategories.ftl. I would like to have a
> > modified copy of this file in my own application.
> > I can create a copy in my application but in order to make ofbiz using
> > it I
> > need to local copy also all the other files in the chain that are:
> > CatalogScreens.xml, CommonScreens.xml and the controller.xml
> >
> > Could anyone make some light for me on this?
> >
>

Re: How to change an ecommerce .ftl file reusing the whole

Posted by Daniel Martínez <da...@paradisosistemas.es>.
Guess this is a message for the user's mailing list

Anyway, there goes my two cents:
I think you already have the answer. AFAIK there is no mechanism in 
OfBiz to "overload" a request-map/view-map (which you'd need to change 
the location of the widget XML file)

If I am not wrong you have two options:

1- Copy over the controller.xml file from ecommerce and make your local 
changes.
2- Use a different request name for your modified screen than the original.

regards,
--
Daniel Martínez

Bruno Busco escribió:
> Hi,
> as long as I go deeper and deeper in ofbiz I can appreciate the very good
> design of this application.
>
> Now I need to make a my own eshop module and I want to be sure I am using
> all the re-use mechanism you have designed.
> - I have created an eshop application under the hot-deploy, here I have all
> my data files using the "ext" reader, with the data file I have defined my
> show, website, facilities, catalogs and categories.
> - In my eshop application, I have the controller.xml file that (as seen in
> ecommerce clone example) includes the ecommerce application controller with
> the line
> <include
> location="component://ecommerce/webapp/ecommerce/WEB-INF/controller.xml"/>
>
> - In my eshop application there is also the images folder with a modified
> copy of the ecommerce.css file and all required gif
>
> Now I need little changes in some of the .ftl files. I want not to modify
> the original files of the ecommerce application so that I can better follow
> the development and update without conflicts.
>
> Is there a mechanism that let me have one or more additional .ftl files in
> my application and all standard .ftl under the original ecommerce?
>
> For example:
> I have changed the minilastviewedcategories.ftl. I would like to have a
> modified copy of this file in my own application.
> I can create a copy in my application but in order to make ofbiz using it I
> need to local copy also all the other files in the chain that are:
> CatalogScreens.xml, CommonScreens.xml and the controller.xml
>
> Could anyone make some light for me on this?

Re: How to change an ecommerce .ftl file reusing the whole

Posted by Raj Saini <ra...@gmail.com>.
I do the following in such situation.

1. Create new screens in the widget folder, generally copying similar 
screen from the e-commerce.
2. Modify the required screen to include ftl in my application. It 
removes the reference to e-commerce ftl file.
3. Add a view map, generally copying similar view-map from e-commerce 
and modify it to point to newly created screen in my application instead 
of e-commerce.

Copying similar screens from e-commerce helps me re-using most of the 
action stuff (bsh, field definition etc).

Thanks,

Raj

Bruno Busco wrote:
> Hi,
> as long as I go deeper and deeper in ofbiz I can appreciate the very good
> design of this application.
>
> Now I need to make a my own eshop module and I want to be sure I am using
> all the re-use mechanism you have designed.
> - I have created an eshop application under the hot-deploy, here I have all
> my data files using the "ext" reader, with the data file I have defined my
> show, website, facilities, catalogs and categories.
> - In my eshop application, I have the controller.xml file that (as seen in
> ecommerce clone example) includes the ecommerce application controller with
> the line
> <include
> location="component://ecommerce/webapp/ecommerce/WEB-INF/controller.xml"/>
>
> - In my eshop application there is also the images folder with a modified
> copy of the ecommerce.css file and all required gif
>
> Now I need little changes in some of the .ftl files. I want not to modify
> the original files of the ecommerce application so that I can better follow
> the development and update without conflicts.
>
> Is there a mechanism that let me have one or more additional .ftl files in
> my application and all standard .ftl under the original ecommerce?
>
> For example:
> I have changed the minilastviewedcategories.ftl. I would like to have a
> modified copy of this file in my own application.
> I can create a copy in my application but in order to make ofbiz using it I
> need to local copy also all the other files in the chain that are:
> CatalogScreens.xml, CommonScreens.xml and the controller.xml
>
> Could anyone make some light for me on this?
>
> Thank you
>
> -Bruno
>
>   


How to change an ecommerce .ftl file reusing the whole

Posted by Bruno Busco <br...@gmail.com>.
Hi,
as long as I go deeper and deeper in ofbiz I can appreciate the very good
design of this application.

Now I need to make a my own eshop module and I want to be sure I am using
all the re-use mechanism you have designed.
- I have created an eshop application under the hot-deploy, here I have all
my data files using the "ext" reader, with the data file I have defined my
show, website, facilities, catalogs and categories.
- In my eshop application, I have the controller.xml file that (as seen in
ecommerce clone example) includes the ecommerce application controller with
the line
<include
location="component://ecommerce/webapp/ecommerce/WEB-INF/controller.xml"/>

- In my eshop application there is also the images folder with a modified
copy of the ecommerce.css file and all required gif

Now I need little changes in some of the .ftl files. I want not to modify
the original files of the ecommerce application so that I can better follow
the development and update without conflicts.

Is there a mechanism that let me have one or more additional .ftl files in
my application and all standard .ftl under the original ecommerce?

For example:
I have changed the minilastviewedcategories.ftl. I would like to have a
modified copy of this file in my own application.
I can create a copy in my application but in order to make ofbiz using it I
need to local copy also all the other files in the chain that are:
CatalogScreens.xml, CommonScreens.xml and the controller.xml

Could anyone make some light for me on this?

Thank you

-Bruno