on 09-08-2004 1:05 AM
Hello,
Does anyone know of a easy way to make a model node a collection without having to iterate through all of the elements and add them manually?
Thanks,
Dustin Gronso
Dustin,
What type of model are you using? I mean, if you are working with CMIModel instances (for example, DynamicRFC), then there are should be no problems: you can easly bind CMIObservableList (not sure about name) to node as a complete collection. And sub-nodes could be populated completely dynamically if you define supplying relation role when bind model.
Heck, even without CMIModel, 0..n-cardinality node has bind(Collection) method!
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Christian,
You are right about documentation about TYPE_REVERSEENGINEERED constant. But nevertheless, XMI import wizard produces no model implementation class (.java) only model declaration (.wdmodel + *.wdmodelclass). All info here and below is relevant for SP6-SP8
Therefore output you get IS NOT complete CMI-compatible model, only declaration that allows you to use model at design time (bind context nodes to it). The same is true for importing WebService -- even you get java model class, it does not implement ICMIModel.
Could anyone from WD team enlight us regarding this issue (i.e. not all NW model generation wizards produces CMI models)?
Regards,
VS
Hello VS,
to keep it short: "all NW model generation wizards indeed produce CMI models, even if these models don't implement the CMI interfaces".
To understand this, one must know, that Web Dynpro in NetWeaver 04 accepts two "flavors" of the Common Model Interface (CMI):
1) a typed flavor that defines rules how a (Java Bean like) model should look like so that Web Dynpro can use it for model nodes. For such a model, WD uses the design time metadata (*.wdmodel + *.wdmodelclass files) to learn about the available classes, attributes and relations. Accessor/Mutator methods must conform to the Java Beans spec, as the generated WD context nodes/elements call the corresponding methods directly.
2) a generic flavor that is based on the com.sap.tc.cmi interfaces. For theses models WD has the choice to call typed methods or to rely on the generic interfaces of CMI. The latter provide some additional functionality (e.g. metadata at runtime can be newer than metadata at designtime and WD adopts a model node automatically) not available from the typed interface.
The 2nd flavor is what you name a "complete CMI model". As you can see from the above, the XMI imported model is a complete CMI model as well, at least from the WD point of view.
It is true that XMI imported models don't necessarily implement the CMI interfaces. This is due to the fact that the XMI import is a reverse engineering tool only. It does not wrap the imported model with generated classes. But if the underlying Java classes already implement the CMI interfaces, fine.
Hope that helps a little bit to clarify the issue.
Kind Regards, Frank
Hi Dustin,
there is one special collection called ICMIObservableList. When you bind that one to the context it's actually directly bound without their elements beeing copied into to the context.
So with this collection you have the possibility to either use context or collection functions.
The only thing you have to do to get this running is to write your own implmentation of the ICMIObservableList. But this is a easy job as you can use e.g. an ArrayList in your implementation of the ICMIObservableList.
If you need more information just post a message.
Best regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.