20-08-2012 04:19 PM
In java API, how do I know what metaClass a MegaObject represents? Also how do I find its short name? How do I traverse its relations with other objects? (like Meta Associations)?
I tried this but I am not sure if this is the right usage:
MegaObjectProperty prop = new MegaObjectProperty(object.megaField(),"~Z20000000D60[Short Name]");
Solved! Go to Solution.
20-08-2012 08:11 PM
Thanks for the quick response!
20-08-2012 07:18 PM
My answer is still the same. The identifier you provide in "getProp" is the identifier of the MetaAttribute Short Name. As a result, it's the same identifier no matter the MetaClass you're using.
I know that all the MetaClass don't show the MetaAttribute Short Name, but it exists for all of them for what I know.
20-08-2012 07:03 PM
P
What I meant to as was - would this be the same for all meta classes: ~Z20000000D60[Short Name]?
I was expecting to see an attribute for short name inside generated vocabulary classes for each meta classes, but it doesnt seem to be the case. So I was a little confused.
20-08-2012 06:25 PM
Yes, the identifier is the identifier of the MetaAttribute Short Name, so it will always be the same.
Short Name is not always displayed as a MetaAttribute of a MetaClass, but is available for all of them.
Try : cityPlan.getProp("Short Name"); and you might see it.
Hmm, I can't help you with that much information. What is contained in : CityPlanningArea.ID and in CityPlanningArea.MA_ConvertedNameVersion ?
20-08-2012 06:19 PM - edited 20-08-2012 06:21 PM
is the Shortname attribute identifier the same for every metaobject?
I have generated identifiers for java Components for Meta Classes:City Plan, City Planning Area and Criteria. I dont see Short Name being available in the Vocab that mega generates.
I only see the following:
String id = object.getProp(CityPlanningArea.ID);
String name = object.getProp(CityPlanningArea.MA_ConvertedNameVersion);
When I run them in Eclipse debug, these 2 statements fail.
20-08-2012 04:43 PM
Hi,
How do I know what metaClass a MegaObject represents :
myMegaObject.getClassObject();
How do I find its short name :
myMegaObject.getProp("~Z20000000D60[Short Name]");
I don't get the last question =/
I hope it helps !