![]() |
Access to certain objects by using the SOAP API |
Post Reply
|
| Author | |
hk
Member
Joined: 21.Jul.2008 Location: Germany Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: Access to certain objects by using the SOAP APIPosted: 21.Jul.2008 at 17:33 |
|
Hello,
I use the method allPropertiesValues (MEOop receiver) to get the values of all properties from a receiver (objects, in my case). If the property value is a collection of objects then I get a string with IDs (combination of area_id and object_id). I use these IDs to find the corresponding objects in all graphs by using the method objectSet (MEOop receiver). The problem is that there are objects IDs which are in a collection but not in all graphs. How can I access of these objects. For instance, the problem occurs in the Home automation project. I do not know, how can I get the text fragments objects from a text object by using the API methods? Best regards, Heiko |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 21.Jul.2008 at 17:54 |
|
Hello Heiko!
If you have the string with area_id and object_id, you already have everything you need to make the MEOop of the object in question. E.g. if you have "3_1234" then you just make an MEOop and set its areaID to 3 and its objectID to 1234. There is some example Java code mentioned here in the Digital Watch API version of the AbstractWatchApplication.java class:
StringTokenizer st = new StringTokenizer(oopString, "_", false);
this.graphOop = new com.metacase.MEOop(); this.graphOop.setAreaID(Integer.parseInt(st.nextToken())); this.graphOop.setObjectID(Integer.parseInt(st.nextToken())); In this case the new object is stored in this.graphOop, which you can change to something more sensible in your case, e.g. 'MEOop textFragmentOop'. All the best, Edited by stevek - 21.Jul.2008 at 17:54 |
|
![]() |
|
hk
Member
Joined: 21.Jul.2008 Location: Germany Points: 2 |
Post Options
Thanks(0)
Quote Reply
Posted: 21.Jul.2008 at 19:59 |
|
Hi Steve,
thanks for your answer. My problem is a little different. I want exact copies of objects containing in a property. The property is of datatype collection. I can create a new MEOop (see your code) for each ID in the collection. But I need all other properties of the ID (the correspondig object). To get these properties, I have to find the object with the equal ID in the MetaEdit repository. The problem is that there are some objects which I cannot find because the are not returned by using the objectSet() method. I guess that there are objects which are not contained in graphs, these objects maybe contains in projects? Is that right? In my example (Home automation), I think, the Text fragements are objects which are not contained in graphs. But where are these objects or how can I get these objects. Best regards, Heiko ![]() |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 22.Jul.2008 at 01:01 |
|
Hi Heiko,
When you have an MEOop for each ID in the collection, you have what you want. MEOops are effectively proxies for the real objects (and graphs, relationships, properties etc.) in the models. You can get all the other property values of the object simply by sending allPropertiesValues to the MEOop.
For instance, if you have the MEOop for the single Text object (oid=10_894) in the Main menu graph in Home Automation, and ask for its allPropertiesValues, you'll get an MEAnyArray with one element. That element represents the collection of three TextFragment objects (oids=10_579, 10_196, 10_529). If you make an MEOop for 10_579, you can ask it in turn for its allPropertiesValues - Label="Welcome to the system!", Start address="0x12" and Length="8".
You also said that you wanted "exact copies" of the objects. In fact you're not getting copies, you're getting proxies to the actual objects. As you go further in the Home Automation example, you'll notice that the same object may actually be used in several places: reuse by reference, rather than by copy.
For instance, in the Mode menu graph the TextFragment "...mode..." is used in both the first and second Text object. As you said, TextFragment objects are not directly contained in the VoiceOutput graph, but rather in the Text objects in that graph: VoiceOutput -> Text* -> TextFragment*. You will however also find "...mode..." contained directly in the Text Fragment Library graph, along with all the other TextFragment objects: Library -> TextFragment*. If you change the "...mode..." TextFragment via any of these places, you're always actually changing just the same single TextFragment object, so the change will be visible wherever it is used. This kind of true object reuse brings important benefits to modelers, making working with models faster and more intuitive, and avoiding the problems of typing the same information in several places. Support for it is just one of the things that sets MetaEdit+ apart from other domain-specific modeling tools.
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |