[isidorus-cvs] r1008 - in trunk/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
lgiessmann at common-lisp.net
lgiessmann at common-lisp.net
Wed Oct 19 10:22:42 UTC 2011
Author: lgiessmann
Date: Wed Oct 19 03:22:41 2011
New Revision: 1008
Log:
gdl-frontend: Widgets: implemented the tmcl:reifier-constraint semantics for retrieving data; fixed a bug in the test-schema
Modified:
trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Tue Oct 18 07:39:38 2011 (r1007)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Oct 19 03:22:41 2011 (r1008)
@@ -1959,18 +1959,35 @@
for(int i = 0; i != ((Topic)this.receivedData).getOccurrences(occurrenceType).length(); ++i)
this.addSubItem(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclReifierConstraint)){
- // TODO: implement: reifier-constraint
+ Topic type = TmHelper.getConstrainedStatement(this.getConstraint());
+
+ Topic reifier = null;
+ if(this.receivedData instanceof Topic){
+ JsArray<Name> names = ((Topic)this.receivedData).getNames(type);
+ if(names.length() != 0) reifier = names.get(0).getReifier();
+ if(reifier == null){
+ JsArray<Occurrence> occs = ((Topic)this.receivedData).getOccurrences(type);
+ if(occs.length() != 0) reifier = occs.get(0).getReifier();
+ }
+ } else if(this.receivedData instanceof Association){
+ if(((Association)this.receivedData).getType().equals(type)) type = ((Association)this.receivedData).getType();
+ } else {
+ throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a topic or association, but is: " + this.receivedData.getClass());
+ }
+
+ String str = this.getTopicRepresentation(reifier, this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup());
+ if(str == null) str = "";
+ this.addSubItem(str);
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclVariantNameConstraint)){
// TODO: implement: variant-name-constraint
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclScopeConstraint)){
- // TODO: implement
Topic type = TmHelper.getConstrainedStatement(this.getConstraint());
JsArray<Topic> scope = null;
if(this.receivedData instanceof Topic){
JsArray<Name> names = ((Topic)this.receivedData).getNames(type);
if(names.length() != 0) scope = names.get(0).getScope();
- if(scope != null){
+ if(scope == null){
JsArray<Occurrence> occs = ((Topic)this.receivedData).getOccurrences(type);
if(occs.length() != 0) scope = occs.get(0).getScope();
}
Modified: trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Tue Oct 18 07:39:38 2011 (r1007)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Wed Oct 19 03:22:41 2011 (r1008)
@@ -373,7 +373,7 @@
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-reifier-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-reifier-constraint]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[gdlsrv:service-default-editor-topic-view]"},{"type":"si:[gdl:containee]", "player":"si:[gdlsrv:service-name-iis-text]"}]},
- {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-reifier-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-name-reifier-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-iis-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-iis-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-name-reifier-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-iis-text]"}]},
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-iis-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-iis-text]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-iis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-ii-constraint]"}]}
More information about the Isidorus-cvs
mailing list