Hi,
In the screen https://demo904.ofbiz.org/accounting/control/globalGLSettings the export is expected to use the simple.xml.ftl file to render as suggested by the entry in commonscreen.xml under webcommon <xml><html-template location="component://common/webcommon/includes/simple.xml.ftl"/></xml> Now it does not seem like getting picked up and instead the processing continues to happen using simple.ftl as specified under <html><html-template location="component://common/webcommon/includes/simple.ftl"/></html> Also find that the controller.xml for accounting has an entry <view-map name="ListGlAccountsExport" type="screenxml" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccountsReport" content-type="text/xml"/> Question: 1) What makes the <xml><html-template /></xml> picked up? b) I am able to route it to simple.xml.ftl by simply overwriting the contents of simple.ftl. Do get an XML output as well. Need to change the XML tags though from the ofbiz entity names to target system name tags. What are my options? XSLT or map modified names in form or something else? Thanks in advance Aray |
On Jun 11, 2009, at 5:45 PM, ARays wrote:
> b) I am able to route it to simple.xml.ftl by simply overwriting the > contents of simple.ftl. Do get an XML output as well. Need to change > the XML > tags though from the ofbiz entity names to target system name tags. > What are > my options? XSLT or map modified names in form or something else? That XML format should be readable by Excel, if you use it (or similar tool) you should be able to change/add/remove columns etc... Jacopo smime.p7s (3K) Download Attachment |
Thanks.. Sure it is readable in excel or similar tools.
My requirement however is to output XML that is directly compatible. For example , right now the output I get is as below <OrganizationGlAccount> <glAccountId>100000</glAccountId> <glAccountClassId>ASSET</glAccountClassId> .......... </OrganizationGlAccount> would instead like to output <MyGlAccount> <MyAccountId>100000</MyAccountId> <MyAccountClassId>ASSET</MyAccountClassId> .......... </MyGlAccount> Just changing the tags, that's all. Right now notice that the related form has <auto-fields-entity entity-name="GlAccount" default-field-type="display"/> Tried using individual field output as below <field name="accountId" entry-name="glAccountId"> But this loose the XML tags. Still digging but unsure what am I missing - Aray
|
In reply to this post by aray
On Jun 11, 2009, at 5:45 PM, ARays wrote: > > Hi, > > In the screen https://demo904.ofbiz.org/accounting/control/globalGLSettings > the export is expected to use the simple.xml.ftl file to render as > suggested > by the entry in commonscreen.xml under webcommon > > <xml><html-template > location="component://common/webcommon/includes/simple.xml.ftl"/></ > xml> > > Now it does not seem like getting picked up and instead the processing > continues to happen using simple.ftl as specified under > <html><html-template > location="component://common/webcommon/includes/simple.ftl"/></html> > the recent renderer refactoring that I will try to fix soon) it seems to work to me; in fact I get an output that starts with: <ListGlAccountExport><ListGlAccount><glAccountId><a class="buttontext" href="/accounting/control/GlAccountNavigate? glAccountId=100000">100000</a></glAccountId><accountName>ASSETS</ accountName><glAccountTypeId></ glAccountTypeId><glAccountClassId>Asset</ glAccountClassId><glResourceTypeId>Money</ glResourceTypeId><glXbrlClassId></glXbrlClassId><parentGlAccountId></ parentGlAccountId><postedBalance>$0.00</postedBalance></ListGlAccount> ... As you can see it is an xml file. Are you getting a similar output? Cheers, Jacopo > Also find that the controller.xml for accounting has an entry > <view-map name="ListGlAccountsExport" type="screenxml" > page="component://accounting/widget/ > GlobalGlAccountsScreens.xml#ListGlAccountsReport" > content-type="text/xml"/> > > Question: > 1) What makes the <xml><html-template /></xml> picked up? > b) I am able to route it to simple.xml.ftl by simply overwriting the > contents of simple.ftl. Do get an XML output as well. Need to change > the XML > tags though from the ofbiz entity names to target system name tags. > What are > my options? XSLT or map modified names in form or something else? > > Thanks in advance > Aray > -- > View this message in context: http://www.nabble.com/screenxml----how-does-it-work--tp23983906p23983906.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > smime.p7s (3K) Download Attachment |
In reply to this post by aray
Never mind my previous note.. Was able to get it working with an entry as below
<field name="MyaccountId" entry-name="glAccountId"> <display></display> </field> This outputs with the XML tag using the name supplied. :-) Almost there, now the last hurdle. The output <OrganizationGlAccount> ......... .. </OrganizationGlAccount> comes enclosed within <OrganizationGlAccountExport></OrganizationGlAccountExport> Need to change both of these to look something like <MyGlAccountExport> <MyGlAccount> ......... .. </MyGlAccount> </MyGlAccountExport> Continuing to explore and of course amazed at the powerful things that the framework can do! - Arays
|
In reply to this post by Jacopo Cappellato-4
Reconfirmed https://demo904.ofbiz.org/accounting/control/globalGLSettings
What is happening is it sure is spitting out XML but also including some HTML on top including a print button. Traced the code and see that coming from simple.ftl and not from simple.xml.ftl which is seems designed to spit only XML and nothing else. Not a big deal since I stripped the simple.ftl of the HTML stuff and that just leaves the XML which is how I reached the next step of modifying the tag names. Regret I wasn't clear in my previous note. - Aray
|
In reply to this post by aray
Think XmlFormRenderer.java is the file from which "Export" is getting appended. This being a core portion of the framework, not sure how to go forward without touching it. Is there a easy way to use a custom XMLFormRenderer? The idea is to export GLAccount details for 3rd party accounting package directly meeting their schema. Would like to keep it flexible so that in future it can be easily extended to cover more than 1 3rd party package.
- Aray
|
In reply to this post by aray
I am interfacing to QB but using a different approach, using the content
component. I have created a view entity that marshals the data I want in the columns I want. I use a the dataresource as journal.QBInterface the electronictext I have code that selects the rows I want and then exports the xml, in qb xml format. you can also look at using the tranforms, or take a look at the applications\product\templates\shipment templates for ideas. just to let you know there are other ways to accomplish this. ARays sent the following on 6/11/2009 11:08 AM: > Think XmlFormRenderer.java is the file from which "Export" is getting > appended. This being a core portion of the framework, not sure how to go > forward without touching it. Is there a easy way to use a custom > XMLFormRenderer? The idea is to export GLAccount details for 3rd party > accounting package directly meeting their schema. Would like to keep it > flexible so that in future it can be easily extended to cover more than 1 > 3rd party package. > > - Aray > > > > > ARays wrote: >> Never mind my previous note.. Was able to get it working with an entry as >> below >> >> <field name="MyaccountId" entry-name="glAccountId"> >> <display></display> >> </field> >> >> This outputs with the XML tag using the name supplied. :-) >> >> Almost there, now the last hurdle. The output >> <OrganizationGlAccount> >> ......... >> .. >> </OrganizationGlAccount> >> >> comes enclosed within >> <OrganizationGlAccountExport></OrganizationGlAccountExport> >> >> Need to change both of these to look something like >> >> <MyGlAccountExport> >> <MyGlAccount> >> ......... >> .. >> </MyGlAccount> >> >> </MyGlAccountExport> >> >> Continuing to explore and of course amazed at the powerful things that the >> framework can do! >> >> - Arays >> >> >> ARays wrote: >>> Thanks.. Sure it is readable in excel or similar tools. >>> >>> My requirement however is to output XML that is directly compatible. For >>> example , right now the output I get is as below >>> <OrganizationGlAccount> >>> <glAccountId>100000</glAccountId> >>> <glAccountClassId>ASSET</glAccountClassId> >>> .......... >>> </OrganizationGlAccount> >>> >>> would instead like to output >>> >>> <MyGlAccount> >>> <MyAccountId>100000</MyAccountId> >>> <MyAccountClassId>ASSET</MyAccountClassId> >>> .......... >>> </MyGlAccount> >>> >>> Just changing the tags, that's all. >>> >>> Right now notice that the related form has >>> <auto-fields-entity entity-name="GlAccount" >>> default-field-type="display"/> >>> >>> Tried using individual field output as below >>> <field name="accountId" entry-name="glAccountId"> >>> But this loose the XML tags. >>> >>> Still digging but unsure what am I missing >>> >>> - Aray >>> >>> >>> Jacopo Cappellato-4 wrote: >>>> On Jun 11, 2009, at 5:45 PM, ARays wrote: >>>> >>>>> b) I am able to route it to simple.xml.ftl by simply overwriting the >>>>> contents of simple.ftl. Do get an XML output as well. Need to change >>>>> the XML >>>>> tags though from the ofbiz entity names to target system name tags. >>>>> What are >>>>> my options? XSLT or map modified names in form or something else? >>>> That XML format should be readable by Excel, if you use it (or similar >>>> tool) you should be able to change/add/remove columns etc... >>>> >>>> Jacopo >>>> >>>> >>>> >>>> >>> >> > -- BJ Freeman http://www.businessesnetwork.com/automation http://bjfreeman.elance.com http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro Systems Integrator. |
In reply to this post by aray
Just create a Frremarker template to output entities in whatever format
you want. -Adrian ARays wrote: > Think XmlFormRenderer.java is the file from which "Export" is getting > appended. This being a core portion of the framework, not sure how to go > forward without touching it. Is there a easy way to use a custom > XMLFormRenderer? The idea is to export GLAccount details for 3rd party > accounting package directly meeting their schema. Would like to keep it > flexible so that in future it can be easily extended to cover more than 1 > 3rd party package. > > - Aray > > > > > ARays wrote: >> Never mind my previous note.. Was able to get it working with an entry as >> below >> >> <field name="MyaccountId" entry-name="glAccountId"> >> <display></display> >> </field> >> >> This outputs with the XML tag using the name supplied. :-) >> >> Almost there, now the last hurdle. The output >> <OrganizationGlAccount> >> ......... >> .. >> </OrganizationGlAccount> >> >> comes enclosed within >> <OrganizationGlAccountExport></OrganizationGlAccountExport> >> >> Need to change both of these to look something like >> >> <MyGlAccountExport> >> <MyGlAccount> >> ......... >> .. >> </MyGlAccount> >> >> </MyGlAccountExport> >> >> Continuing to explore and of course amazed at the powerful things that the >> framework can do! >> >> - Arays >> >> >> ARays wrote: >>> Thanks.. Sure it is readable in excel or similar tools. >>> >>> My requirement however is to output XML that is directly compatible. For >>> example , right now the output I get is as below >>> <OrganizationGlAccount> >>> <glAccountId>100000</glAccountId> >>> <glAccountClassId>ASSET</glAccountClassId> >>> .......... >>> </OrganizationGlAccount> >>> >>> would instead like to output >>> >>> <MyGlAccount> >>> <MyAccountId>100000</MyAccountId> >>> <MyAccountClassId>ASSET</MyAccountClassId> >>> .......... >>> </MyGlAccount> >>> >>> Just changing the tags, that's all. >>> >>> Right now notice that the related form has >>> <auto-fields-entity entity-name="GlAccount" >>> default-field-type="display"/> >>> >>> Tried using individual field output as below >>> <field name="accountId" entry-name="glAccountId"> >>> But this loose the XML tags. >>> >>> Still digging but unsure what am I missing >>> >>> - Aray >>> >>> >>> Jacopo Cappellato-4 wrote: >>>> On Jun 11, 2009, at 5:45 PM, ARays wrote: >>>> >>>>> b) I am able to route it to simple.xml.ftl by simply overwriting the >>>>> contents of simple.ftl. Do get an XML output as well. Need to change >>>>> the XML >>>>> tags though from the ofbiz entity names to target system name tags. >>>>> What are >>>>> my options? XSLT or map modified names in form or something else? >>>> That XML format should be readable by Excel, if you use it (or similar >>>> tool) you should be able to change/add/remove columns etc... >>>> >>>> Jacopo >>>> >>>> >>>> >>>> >>> >> > |
Adrian,
The ftl file right now just has one single call ${sections.render("body")} I was searching for ways to drill deeper into body and go by individual elements but couldn't find an example yet to do the same. From your note it seem it should be really easy and guess I am still limited by my understanding here. Would really appreciate any pointers. My other approach is to include a style sheet before the sections.render call and do a xslt transform. Haven't tried it but came across some examples where we are doing such a thing in case of pdf output. - Aray
|
In reply to this post by BJ Freeman
Thanks BJ Freeman. The pointers were really helpful. Even though I was pretty close using screenxml with a view entity, figured that the framework is putting a wrapper tag with Export suffix which is hard to handle without an xslt or a ftl that can manipulate the Form output xml (I couldn't figure out how). So, back to basics simply wrote a screen on the same view and an FTL where I now put the tags element by element as required and everything works as intended.
Would still love to fix the limitation of screenxml but perhaps at a later time when I develop a little more familiarity with the framework. Since you referred QB (my requirement is similar though not QB) did you or anyone try and import from QB to setup initial chart of accounts? I may need something similar shortly and thinking about the possible approaches. Thank again - Aray
|
Free forum by Nabble | Edit this page |