How to edi the <@ofbizUrl/>

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

How to edi the <@ofbizUrl/>

prasanthi_ofbiz
Hi
   In Ofbiz Application the each and every request contains the <@ofbizUrl> url part . I have implemented cash server in ofbiz application. Its working fine, but I have one issue like one of the screen having First, Next, Previous and Last links which will contain the parent url with dynamic parameters. In my application the url contains one ticket number as a paramenter. While clicking on the any one of these links the url picking the parent url which will contain the ticket number as one of the parameter. I don't want this ticket number. So I want to remove the ticket from the <@ofbizUrl>.
 Plese help me in this .....
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Chirag Manocha-3
Hi Prasanthi,
I am not sure but your question is not clear. What is the meaning of ticket number here.
Please specify the exact problem.

About ofbizUrl tag, it is defined in freemarkerTransforms.properties file. Class names are specified for the tags there. OfbizUrlTransform.java class is responsible for rendering of this tag.

Regards
--
Chirag Manocha
Emforium Pvt. Ltd.
Contact :- +91-98735-47457, +91-98263-19099

----- "prasanthi_ofbiz" <[hidden email]> wrote:

> From: "prasanthi_ofbiz" <[hidden email]>
> To: [hidden email]
> Sent: Monday, 10 May, 2010 12:10:28 PM
> Subject: How to edi the <@ofbizUrl/>
>
> Hi
>    In Ofbiz Application the each and every request contains the
> <@ofbizUrl>
> url part . I have implemented cash server in ofbiz application. Its
> working
> fine, but I have one issue like one of the screen having First, Next,
> Previous and Last links which will contain the parent url with
> dynamic
> parameters. In my application the url contains one ticket number as a
> paramenter. While clicking on the any one of these links the url
> picking the
> parent url which will contain the ticket number as one of the
> parameter. I
> don't want this ticket number. So I want to remove the ticket from
> the
> <@ofbizUrl>.
>  Plese help me in this .....
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/How-to-edi-the-ofbizUrl-tp2165006p2165006.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

prasanthi_ofbiz
Thanks for u r reply.
   As I posted previously i have implemented Cash server system to the Ofbiz application. For this we will validate the user from the cash server and then gives control to the ofbiz server for second validation. At that time we will validate the user by encrypting the user and set it to to a validable called ticket, which will appended to the url.
On click of Accounting-->Global GL Settings--> [First/Previous/Next/Last] its appending some parameters with the precious ofbiz url,
ex: https://localhost:8443/accounting/control/globalGLSettings?noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#

I want to know where this noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1# parameters were appending to the basic ofbiz url, <@ofbizUrl> and at the same time I want to remove the ticket from the <@ofbizUrl> which have url likehttps://localhost:8443/accounting/control/globalGLSettings?ticket=ST-4fdgdfgdfg-dfd
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Shubham Dubey
Hi prasanthi

I think you want to clear some parameters from parameters list at an
intermediate situation.
In my opinion, modifying the basic transform rule would not be proper
thing to do in ofbiz. As it  might affect your application performance
in some other place.

(1)Why don't you retrive those parameter in corresponding ftl after your
main purpose of using it is over and set them to null furthur which you
don't want to carry them.
(2)If you are using services then you can clear those parameters fields
using <clear-field>tag.

Thanks & Regards
Shubham

prasanthi_ofbiz wrote:

> Thanks for u r reply.
>    As I posted previously i have implemented Cash server system to the Ofbiz
> application. For this we will validate the user from the cash server and
> then gives control to the ofbiz server for second validation. At that time
> we will validate the user by encrypting the user and set it to to a
> validable called ticket, which will appended to the url.
> On click of Accounting-->Global GL Settings--> [First/Previous/Next/Last]
> its appending some parameters with the precious ofbiz url,
> ex:
> https://localhost:8443/accounting/control/globalGLSettings?noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#
>
> I want to know where this noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#
> parameters were appending to the basic ofbiz url, <@ofbizUrl> and at the
> same time I want to remove the ticket from the <@ofbizUrl> which have url
> likehttps://localhost:8443/accounting/control/globalGLSettings?ticket=ST-4fdgdfgdfg-dfd
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

prasanthi_ofbiz
Yeah its a great solution. But the problem here is I am not able to find the .ftl file for this screen and I am not sure where this url is framing and sending as a request to the server. Please let me know the ftl file and the file where the new parameters,noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#  were appending to <@ofbizUrl>
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Shubham Dubey

Parameters get appended to the url as follows,also you can specify
conditions and respective actions here as given :

<@ofbizUrl><#if
!grandTotal?exists>reconcileFinAccountTrans?clearAll=Y</@ofbizUrl>


Concerning searching the corresponding ftl you can trace it like
browserUriRequest>controller.xml>ScreenView>ftl in that screen


Thanks
Shubham


prasanthi_ofbiz wrote:
> Yeah its a great solution. But the problem here is I am not able to find the
> .ftl file for this screen and I am not sure where this url is framing and
> sending as a request to the server. Please let me know the ftl file and the
> file where the new
> parameters,noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#  were appending
> to <@ofbizUrl>
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Jacques Le Roux
Administrator
Even if in this case it may be OK, you should avoid this at large for security reasons

Have a look at https://issues.apache.org/jira/browse/OFBIZ-2330

Jacques

From: "Shubham Dubey" <[hidden email]>

> Parameters get appended to the url as follows,also you can specify
> conditions and respective actions here as given :
>
> <@ofbizUrl><#if
> !grandTotal?exists>reconcileFinAccountTrans?clearAll=Y</@ofbizUrl>
>
>
> Concerning searching the corresponding ftl you can trace it like
> browserUriRequest>controller.xml>ScreenView>ftl in that screen
>
>
> Thanks
> Shubham
>
>
> prasanthi_ofbiz wrote:
>> Yeah its a great solution. But the problem here is I am not able to find the
>> .ftl file for this screen and I am not sure where this url is framing and
>> sending as a request to the server. Please let me know the ftl file and the
>> file where the new
>> parameters,noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#  were appending
>> to <@ofbizUrl>
>>
>>  
>

Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Shubham Dubey
Thanks Jacques
 
For adding that thing.

Thanks
Shubham


Jacques Le Roux wrote:

> Even if in this case it may be OK, you should avoid this at large for
> security reasons
>
> Have a look at https://issues.apache.org/jira/browse/OFBIZ-2330
>
> Jacques
>
> From: "Shubham Dubey" <[hidden email]>
>> Parameters get appended to the url as follows,also you can specify
>> conditions and respective actions here as given :
>>
>> <@ofbizUrl><#if
>> !grandTotal?exists>reconcileFinAccountTrans?clearAll=Y</@ofbizUrl>
>>
>>
>> Concerning searching the corresponding ftl you can trace it like
>> browserUriRequest>controller.xml>ScreenView>ftl in that screen
>>
>>
>> Thanks
>> Shubham
>>
>>
>> prasanthi_ofbiz wrote:
>>> Yeah its a great solution. But the problem here is I am not able to
>>> find the
>>> .ftl file for this screen and I am not sure where this url is
>>> framing and
>>> sending as a request to the server. Please let me know the ftl file
>>> and the
>>> file where the new
>>> parameters,noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#  were
>>> appending
>>> to <@ofbizUrl>
>>>
>>>  
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

prasanthi_ofbiz
In reply to this post by Shubham Dubey
Dear Shubham ,
           I followed the same steps as you specified. Like browserUriRequest>controller.xml>ScreenView>ftl in that screen
browserUriRequest=globalGLSettings
controller.xml =<view-map name="FindGlobalGlAccount" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccounts"/>
ScreenView=ListGlAccounts, this Screen contains the code below

Screen:ListGlAccountsglobalGLSettings.png

<screen name="ListGlAccounts">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleListAccounts"/>
                <set field="labelTitleProperty" value="PageTitleListAccounts"/>
                <set field="tabButtonItem" value="Chartofaccounts"/>
               
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
                <set field="dummyParameter" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
            </actions>
            <widgets>
                <decorator-screen name="GlobalGLSettingsDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                       <include-menu name="GlSettingTabBar" location="component://accounting/widget/Menus.xml"/>
                       <container style="screenlet">
                            <container style="screenlet-title-bar">
                                <container style="h3">
                                    <label text="${uiLabelMap[labelTitleProperty]}"/>
                                </container>
                            </container>
                            <container style="screenlet-body">
                                <section>
                                    <widgets>
                                        <container style="button-bar">
                                            <link target="ListGlAccountsReport" text="${uiLabelMap.CommonPrint}" style="buttontext"/>
                                            <link target="ListGlAccountsExport" text="${uiLabelMap.CommonExport}" style="buttontext"/>
                                        </container>
                                        <include-form name="ListGlAccount" location="component://accounting/widget/GlobalGlAccountsForms.xml"/>
                                    </widgets>
                                </section>
                            </container>
                        </container>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

Form :ListGlAccounts

<form name="ListGlAccount" list-name="listIt" target="" title="" type="list" default-entity-name="GlAccount"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <actions>
            <set field="entityName" value="GlAccount"/>
            <set field="noConditionFind" value="Y"/>
            <service service-name="performFind" result-map="result" result-map-list="listIt">
                <field-map field-name="inputFields" from-field="parameters"/>
                <field-map field-name="entityName" from-field="entityName"/>
                <field-map field-name="noConditionFind" value="Y"/>
            </service>
            <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/>
        </actions>
       
        <field name="glAccountId" title="Gl Account Id" widget-style="buttontext">
            <hyperlink also-hidden="false" description="${glAccountId}" target="GlAccountNavigate">
                <parameter param-name="glAccountId"/>
            </hyperlink>
        </field>
        <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field>
        <field name="glAccountTypeId"><display-entity entity-name="GlAccountType"/></field>
        <field name="glAccountClassId"><display-entity entity-name="GlAccountClass"/></field>
        <field name="glResourceTypeId"><display-entity entity-name="GlResourceType"></display-entity></field>
        <field name="glXbrlClassId"><display-entity entity-name="GlXbrlClass"></display-entity></field>
        <field name="parentGlAccountId"><display-entity entity-name="GlAccount" description="${accountName} [${glAccountId}]" key-field-name="glAccountId"></display-entity></field>
        <field name="accountCode"><hidden/></field>
        <field name="postedBalance" widget-area-style="align-text" title-area-style="align-text"><display type="currency" currency="${defaultCurrencyUomId}"/></field>
    </form>



There is no ftl file specifiation in the screen as well as in the form.
In other cases I am able to get the .ftl file where as only in this case I am not able to found it...
Please help me.
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Shubham Dubey
Ftl can be present in included screens as well,in your case it is
Decorator at main decorator location,so it is less possible to be there.
Form widget are also used to perform same functions as ftl,but there
scope is limited.
Parameters can be set any where,not important that they will be ftl only.




Thanks $ Regards
Shubham Dubey





prasanthi_ofbiz wrote:

> Dear Shubham ,
>            I followed the same steps as you specified. Like
> browserUriRequest>controller.xml>ScreenView>ftl in that screen
> browserUriRequest=globalGLSettings
> controller.xml =<view-map name="FindGlobalGlAccount" type="screen"
> page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccounts"/>
> ScreenView=ListGlAccounts, this Screen contains the code below
>
> Screen:ListGlAccounts
> http://n4.nabble.com/file/n2165305/globalGLSettings.png globalGLSettings.png
>
> <screen name="ListGlAccounts">
>         <section>
>             <actions>
>                 <set field="titleProperty" value="PageTitleListAccounts"/>
>                 <set field="labelTitleProperty"
> value="PageTitleListAccounts"/>
>                 <set field="tabButtonItem" value="Chartofaccounts"/>
>                 <!-- no longer works requies a fieldMap entity-and
> entity-name="GlAccount" list="entityList" use-cache="true" >
>                     <limit-range start="0" size="20"/>
>                 </entity-and -->
>                 <set field="viewIndex" from-field="parameters.VIEW_INDEX"
> type="Integer" default-value="0"/>
>                 <set field="viewSize" from-field="parameters.VIEW_SIZE"
> type="Integer" default-value="50"/>
>                 <set field="dummyParameter"
> from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
>             </actions>
>             <widgets>
>                 <decorator-screen name="GlobalGLSettingsDecorator"
> location="${parameters.mainDecoratorLocation}">
>                     <decorator-section name="body">
>                        <include-menu name="GlSettingTabBar"
> location="component://accounting/widget/Menus.xml"/>
>                        <container style="screenlet">
>                             <container style="screenlet-title-bar">
>                                 <container style="h3">
>                                     <label
> text="${uiLabelMap[labelTitleProperty]}"/>
>                                 </container>
>                             </container>
>                             <container style="screenlet-body">
>                                 <section>
>                                     <widgets>
>                                         <container style="button-bar">
>                                             <link
> target="ListGlAccountsReport" text="${uiLabelMap.CommonPrint}"
> style="buttontext"/>
>                                             <link
> target="ListGlAccountsExport" text="${uiLabelMap.CommonExport}"
> style="buttontext"/>
>                                         </container>
>                                         <include-form name="ListGlAccount"
> location="component://accounting/widget/GlobalGlAccountsForms.xml"/>
>                                     </widgets>
>                                 </section>
>                             </container>
>                         </container>
>                     </decorator-section>
>                 </decorator-screen>
>             </widgets>
>         </section>
>     </screen>
>
> Form :ListGlAccounts
>
> <form name="ListGlAccount" list-name="listIt" target="" title="" type="list"
> default-entity-name="GlAccount"
>         odd-row-style="alternate-row" default-table-style="basic-table
> hover-bar">
>         <actions>
>             <set field="entityName" value="GlAccount"/>
>             <set field="noConditionFind" value="Y"/>
>             <service service-name="performFind" result-map="result"
> result-map-list="listIt">
>                 <field-map field-name="inputFields"
> from-field="parameters"/>
>                 <field-map field-name="entityName" from-field="entityName"/>
>                 <field-map field-name="noConditionFind" value="Y"/>
>             </service>
>             <property-to-field field="defaultCurrencyUomId"
> resource="general" property="currency.uom.id.default" default="USD"/>
>         </actions>
>         <!--auto-fields-entity entity-name="GlAccount"
> default-field-type="display"/-->
>         <field name="glAccountId" title="Gl Account Id"
> widget-style="buttontext">
>             <hyperlink also-hidden="false" description="${glAccountId}"
> target="GlAccountNavigate">
>                 <parameter param-name="glAccountId"/>
>             </hyperlink>
>         </field>
>         <field name="accountName" entry-name="glAccountId"><display-entity
> entity-name="GlAccount" key-field-name="glAccountId"
> description="${accountName}"/></field>
>         <field name="glAccountTypeId"><display-entity
> entity-name="GlAccountType"/></field>
>         <field name="glAccountClassId"><display-entity
> entity-name="GlAccountClass"/></field>
>         <field name="glResourceTypeId"><display-entity
> entity-name="GlResourceType"></display-entity></field>
>         <field name="glXbrlClassId"><display-entity
> entity-name="GlXbrlClass"></display-entity></field>
>         <field name="parentGlAccountId"><display-entity
> entity-name="GlAccount" description="${accountName} [${glAccountId}]"
> key-field-name="glAccountId"></display-entity></field>
>         <field name="accountCode"><hidden/></field>
>         <field name="postedBalance" widget-area-style="align-text"
> title-area-style="align-text"><display type="currency"
> currency="${defaultCurrencyUomId}"/></field>
>     </form>
>
>
>
> There is no ftl file specifiation in the screen as well as in the form.
> In other cases I am able to get the .ftl file where as only in this case I
> am not able to found it...
> Please help me.
>  
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Adrian Crum
In reply to this post by Shubham Dubey
Also, if you view the page source, you will see HTML comments that tell
you which widgets/templates are being used.

-Adrian

On 5/10/2010 4:11 AM, Shubham Dubey wrote:

>
> Parameters get appended to the url as follows,also you can specify
> conditions and respective actions here as given :
>
> <@ofbizUrl><#if
> !grandTotal?exists>reconcileFinAccountTrans?clearAll=Y</@ofbizUrl>
>
>
> Concerning searching the corresponding ftl you can trace it like
> browserUriRequest>controller.xml>ScreenView>ftl in that screen
>
>
> Thanks
> Shubham
>
>
> prasanthi_ofbiz wrote:
>> Yeah its a great solution. But the problem here is I am not able to
>> find the
>> .ftl file for this screen and I am not sure where this url is framing and
>> sending as a request to the server. Please let me know the ftl file
>> and the
>> file where the new
>> parameters,noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1# were
>> appending
>> to <@ofbizUrl>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Atul Vani
In reply to this post by prasanthi_ofbiz
hi prasanthi,

where (which url's which button) did you got the ticket parameter,
coz in ofbiz trunk if you visit
https://localhost:8443/accounting/control/globalGLSettings
and check the [First/Previous/Next/Last] button's  target then it's not
present there.

--
Thanks & Regards
Atul Vani
Jr. Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/


prasanthi_ofbiz wrote:

> Thanks for u r reply.
>    As I posted previously i have implemented Cash server system to the Ofbiz
> application. For this we will validate the user from the cash server and
> then gives control to the ofbiz server for second validation. At that time
> we will validate the user by encrypting the user and set it to to a
> validable called ticket, which will appended to the url.
> On click of Accounting-->Global GL Settings--> [First/Previous/Next/Last]
> its appending some parameters with the precious ofbiz url,
> ex:
> https://localhost:8443/accounting/control/globalGLSettings?noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#
>
> I want to know where this noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1#
> parameters were appending to the basic ofbiz url, <@ofbizUrl> and at the
> same time I want to remove the ticket from the <@ofbizUrl> which have url
> likehttps://localhost:8443/accounting/control/globalGLSettings?ticket=ST-4fdgdfgdfg-dfd
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

prasanthi_ofbiz
Dear Atul Vani ,
       That ticket is exist in my application because i have implemented the Cash Server in my application, there for each and every request my cash server validate a ticket for my security reasons so, it won't exist in the normal application.
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Atul Vani
Hi Prasanthi,

"I want to know where this
noConditionFind=N&VIEW_SIZE_1=20&VIEW_INDEX_1=1# parameters were
appending to the basic ofbiz url"

it's in MacroFormRenderer.java
line no. 2108 (renderNextPrev function)

try to create your form in ftl rather then using form-widget,
that will simplify things up.

--
Thanks & Regards
Atul Vani
Jr. Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/


prasanthi_ofbiz wrote:
> Dear Atul Vani ,
>        That ticket is exist in my application because i have implemented the
> Cash Server in my application, there for each and every request my cash
> server validate a ticket for my security reasons so, it won't exist in the
> normal application.
>  

Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

prasanthi_ofbiz
Hi Atul Vani ,
        I have changed code according to my requirement in renderNextPrev and given some debugger statements but no use, even the debugger statements are also not printed in the log. Can u pls let me know whats the problem...
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

Atul Vani
In reply to this post by prasanthi_ofbiz
Hi Prasanthi,

Its not recommended to change those files, coz chances are that you may end up breaking other functionality,
use ftl to make your form (it's similar to HTML), a good example to how things work in ftl can be findparty.ftl

about "even the debugger statements are also not printed in the log"
well it doesn't happen, or may be please check if the log message is inside of any 'if' condition mistakenly...


----- Original Message -----
From: "prasanthi_ofbiz" <[hidden email]>
To: [hidden email]
Sent: Tuesday, May 11, 2010 8:51:09 PM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi
Subject: Re: How to edi the <@ofbizUrl/>


Hi Atul Vani ,
        I have changed code according to my requirement in renderNextPrev
and given some debugger statements but no use, even the debugger statements
are also not printed in the log. Can u pls let me know whats the problem...
--
View this message in context: http://ofbiz.135035.n4.nabble.com/How-to-edi-the-ofbizUrl-tp2165006p2173972.html
Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to edi the <@ofbizUrl/>

prasanthi_ofbiz
Hi Atul Vani ,
      Thanks for your great reply. Actual link url for this page [Next/Previous/First/Last] were framing in the HtmlFormRender.java  file located framework/widget/src/org/ofbiz/widget/html/.
Additional Code
String url=prepLinkText;
        int exists=url.indexOf("ticket");        
    if(exists>0)
    {
    String secondPart = url.substring(url.indexOf("ticket"));
        //Debug.log("final url>>>>"+url.substring(0,url.indexOf("ticket"))+secondPart.substring(secondPart.indexOf("&")+1));
    prepLinkText=url.substring(0,url.indexOf("ticket"))+secondPart.substring(secondPart.indexOf("&")+1);
    }

This code written below the line prepLinkText += viewSizeParam + "=" + viewSize + "&" + viewIndexParam + "=";
Now its working fine.

Thanks & Regards,
Prasanthi