cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding application created in NWDS from metadata xml

Former Member
0 Kudos

Hi,

I have few queries regarding the application created out of meta data xml file

In NWDS SP9, the application created was syncbo specific.

There would be a class for each syncbo with its appropriate get and set methods. I feel this easier to understand and develop

From SP14, NWDS generates the application data logic in generic format from meta data xml file.

1.Is there any documentation to understand the basic application created from metadata xml file in SP14 .

Typically each jsp would be displaying a particular syncbo. Hence I feel that Sp9 application is better equipped for enhancements.

2. Can I use metadata from SAP Web AS SP14 in NWDS Sp9.

3. Will the application created in NWDS SP9 work on MI Client14.

We have multiple syncbos and jsps in our project. Hence these queries

Regards

Raja Sekhar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kishore,

Thanks a lot for your reply.

Few more queries,

The standard app which is generated by the NWDS from metadata xml file, displays the syncbos in the form of a table and when clicked on a particular syncbo displays its contents.

I have an application on order management, which has list of orders displayed in a table. Each order row in the table also has links to the corresponding functional loc, equipment details links and when these are clicked the corresponding details need to be displayed.

For the above scenario,would the single interface TableContentProvider.java and single bean TableViewBean.java generated by the standard app suffice.

Because the bean needs to store differnt kinds of data like orders or equipment details depending on the events.

Hence I assume that the app will be in the following way

1. Bean for each syncbo like order which gets all the contents

2. controller file for each syncbo which will be called from the main controller depending on the event. This controller would inturn instantiate the bean and fill the details required by the jsp.

Are my assumptions correct.

Is there any standard way to design my app in SAP MI ?

Regards

Raja Sekhar

kishorg
Advisor
Advisor
0 Kudos

Hi Raja,

In the generated application , we can see ..

Bean Class -- In this , we can see so many static Vector instances to store the data which is to be dispalyed on the JSP page after the result of the event.

We dont have number of bean instances .. We can create number of instances for storing the data of of the various SyncBos .. Instead of creating new instances of the TableViewBean , we can include one more static vector instance for storing the data of the particular SyncBo.

The application flow or the working is like this ...

1) When one event is triggered from the JSP page , then it is redirected to the main controller(which is automatically generated during project creation).

2) The main controller have methods like

doInitialize() -


called when the servlet is activated the first time (just like the init() method in HttpServlet

doHandleEvent(..) -


called any subsequent time when an event on the web client occurs.

From our controller class , we can see the method,

This controller class is exteding the functionalities of AbstractMEHttpServlet .

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

public String doHandleEvent(....) , this is the abstract method present in the AbstractMEHttpServlet.

We can see its implementation in the generated controller class.

This method is handling the entire events started from the JSP pages.

public String doHandleEvent(

String eventName,

HttpServletRequest request,

HttpServletResponse response) .

In the JSP page , we can see that ,

(This is applicable when we use submit event in forms)

<input type="submit" value="Back to SyncBo instances" class="image" name="_event_navGoToSelectedSyncBos">

In the case of events triggered with the submib button , it is recommended that , we have to put the prefix event .

After triggering an event with submit button , in the doHandleEvent , internally that prefix is automatically removed from the event name to find out the exact event name. This detail u can see from the help itself.

The return parameter of the method is string and is the name(relative path with reference to the jsp folder in the generated project) of the JSP page which is to be displayed.

So while including new JSP pages to ur application , what u have to do is , just create a subfolder inside the jsp folder and then create ur new JSP files.

in the Constants.java file ,one main thing to be noted is that,,

while assigning values to string variables , which are to be used for return parameter of the method doHandleEvent(..)

String JSP_NEW_PAGE = "/jsp/<ur folder name>/<jsp page>";

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

3) Inside this method , depending upon the particular event name , we are calling proper methods which are in the Main Controller..

If we have so many SyncBOs , we have to write so many methods inside this Main Controller . This can be avoided by

creating public Classes for each SyncBOs (in this , u can write methods which are to be called from the Main Controller ).

U can create Static methods inside this classes and u can call this directly from the Main Controller.

Regards

Kishor Gopinathan

kishorg
Advisor
Advisor
0 Kudos

Hi Raja ,

<<1>>

This is the general structure of applications developed from Sp 11 onwards..

1) one bean directory -

contains the TableViewBean.java file -> A bean used as databag to transport data from a servlet to the JSP

2) one dataaccess directory -

which contain the TableContentProvider.java file and SmartSyncDBAccess.java file

TableContentProvider.java

-


Our controller class is accessing the methods directly from the instance of TableContentProvider.

This act as an interface between the Persistence class(SmartSyncDBAccecc.java) and the Controler file.

SmartSyncDBAccess.java

-


Access to the Smart Sync data on the MI client.We can implement methods for manipulating the data on the client device.

3) <Controller Name>.java -


This is the one and only controller file in the MI application. We have to handle the entire events using this common controller.

This is the one limitation of applications in higher versions. This can be avoided by Creating our own Controller classes for our use. We have to write specific methods in our Custom controller classes. We only have to call these methods from our main Controller class (which is specified during application creation) for handling particular events.

In these applications , we have the provision to make use of the SmartSync API directly , so there is no proxy methods and hence there is no difficulty in migration.

In the case of SP 11 or higher versions , the risk is to understand the API's . Proper documentation is vailable on that.

<<Can I use metadata from SAP Web AS SP14 in NWDS Sp9.

>>

That meRepMeta.xml file is generated from the server itself. so there is no problem . U can use that for application development in SP 14 and SP 09.

<<3. Will the application created in NWDS SP9 work on MI Client14.

>>

In the case of application developed using SP 09 version of studio , during export , we can see two additional jar files are also included with the application WAR file.

mbscore.jar and mbsmake.jar files ..

i tried to work with SP 09 app in SP15 client . at that time i got one exception .

i think the working of SP 09 application is initiated using the mbscore.jar file itself . I have not found any relevant help regarding the APIs..

just refer the last reply of this forum ...

Regards

Kishor Gopinathan