From: Sergio V. S. <sv...@ig...> - 2005-09-09 14:28:45
|
Hi, I have just added a new capability to the listing module located at fisterra basic modules. Sometimes we want to perform listings that dependes on the machine where the server is located. For example when I want to list the items of my own warehouse. We used to pass the hostcode of the server from the client as a hidden rule, but our policy is never trust the client so we had to achieve a better solution. We decided to add a new tag called |<hostcode/>| that will be placed in the listing source file inside a |<table>| tag into the from section. For example: <table name="warehouse" alias="war" join-cond="st.warehouse = war.code" left="yes"> <hostcode/> </table> The listing service will proceed as follows once the tag hostcode was detected: * recover the hostcode with |f_parameter_manager| * add a condition to the join condition built from this |<table>| tag. The condition follows this structure: [name_of_the_parent_tag].hostcode = hostcode (acquired in the first step) So the join condition will be: |(st.warehouse = war.code) and (war.hostcode = 1)| (supose the |f_parameter_manager| returned 1 as the value of the host code). Greetings. |