isidorus-cvs
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
October 2011
- 1 participants
- 35 discussions

[isidorus-cvs] r1012 - in trunk/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
by lgiessmann@common-lisp.net 20 Oct '11
by lgiessmann@common-lisp.net 20 Oct '11
20 Oct '11
Author: lgiessmann
Date: Thu Oct 20 00:47:07 2011
New Revision: 1012
Log:
gdl-frontend: Widgets: implemented the gdlt:Variant-Identifiers-Scope and gdlt:Datatype semantics for retrieving data
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/PSIs.java
trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.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 Thu Oct 20 00:14:01 2011 (r1011)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Oct 20 00:47:07 2011 (r1012)
@@ -1981,23 +1981,9 @@
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclVariantNameConstraint)){
if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
- Topic nameType = TmHelper.getConstrainedStatement(this.getRootConstraint());
- JsArray<Name> names = ((Topic)this.receivedData).getNames(nameType);
- Topic scope = TmHelper.getConstrainedScopeTopic(this.getRootConstraint());
- JsArray<Variant> variants = names.get(0).getVariants();
-
- for(int varIdx = 0; varIdx != variants.length(); ++varIdx){
- if(variants.get(varIdx).getScope().length() != 0){
- JsArray<Topic> scopes = variants.get(varIdx).getScope();
- int scopeIdx = 0;
- for( ; scopeIdx != scopes.length(); ++scopeIdx) if(scopes.get(scopeIdx).equals(scope)) break;
-
- if(scopeIdx != scopes.length()){
- this.addSubItem(variants.get(varIdx).getValue());
- break;
- }
- }
- }
+ ArrayList<Variant> variants = TmHelper.getVariantsForConstraint((Topic)this.receivedData, this.getConstraint());
+ if(variants.size() != 0) this.addSubItem(variants.get(0).getValue());
+ else this.addSubItem("");
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclScopeConstraint)){
Topic type = TmHelper.getConstrainedStatement(this.getConstraint());
@@ -2052,29 +2038,40 @@
if(str == null) str = "";
this.addSubItem(str);
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlDatatype)){
- // TODO: implement: Datatype
+ if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+
+ if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclVariantNameConstraint)){
+ ArrayList<Variant> variants = TmHelper.getVariantsForConstraint((Topic)this.receivedData, this.getRootConstraint());
+ if(variants.size() != 0){
+ this.addSubItem(variants.get(0).getDatatype().getReference());
+ }
+ } else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclOccurrenceConstraint)){
+ Topic occType = TmHelper.getConstrainedStatement(this.getRootConstraint());
+ JsArray<Occurrence> occs = ((Topic)this.receivedData).getOccurrences(occType);
+ if(occs.length() != 0) this.addSubItem(occs.get(0).getDatatype().getReference());
+ } else {
+ throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a constraint of the type " + PSIs.TMCL.tmclVariantNameConstraint + " or " + PSIs.TMCL.tmclOccurrenceConstraint + ", but is bound to: " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()));
+ }
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlVariantNameIdentifiers)){
- // TODO: implement: Variant-Name-Identifiers
+ if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+ if(!TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclVariantNameConstraint)) throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a constraint of the type " + PSIs.TMCL.tmclVariantNameConstraint + ", but is bound to: " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()));
+
+ ArrayList<Variant> variants = TmHelper.getVariantsForConstraint((Topic)this.receivedData, this.getRootConstraint());
+ if(variants.size() != 0){
+ for(int i = 0; i != variants.get(0).getItemIdentifiers().length(); ++i) this.addSubItem(variants.get(0).getItemIdentifiers().get(i).getReference());
+ }
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlVariantNameReifier)){
+ if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+ if(!TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclVariantNameConstraint)) throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a constraint of the type " + PSIs.TMCL.tmclVariantNameConstraint + ", but is bound to: " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()));
+
// TODO: implement: Variant-Name-Reifier
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlVariantNameScope)){
if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
- Topic nameType = TmHelper.getConstrainedStatement(this.getRootConstraint());
- JsArray<Name> names = ((Topic)this.receivedData).getNames(nameType);
- Topic scope = TmHelper.getConstrainedScopeTopic(this.getRootConstraint());
- JsArray<Variant> variants = names.get(0).getVariants();
-
- for(int varIdx = 0; varIdx != variants.length(); ++varIdx){
- if(variants.get(varIdx).getScope().length() != 0){
- JsArray<Topic> scopes = variants.get(varIdx).getScope();
- int scopeIdx = 0;
- for( ; scopeIdx != scopes.length(); ++scopeIdx) if(scopes.get(scopeIdx).equals(scope)) break;
-
- if(scopeIdx != scopes.length()){
- for(int i = 0; i != scopes.length(); ++i) this.addSubItem(this.getTopicRepresentation(scopes.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
- }
- }
+ if(!TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclVariantNameConstraint)) throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a constraint of the type " + PSIs.TMCL.tmclVariantNameConstraint + ", but is bound to: " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()));
+
+ ArrayList<Variant> variants = TmHelper.getVariantsForConstraint((Topic)this.receivedData, this.getRootConstraint());
+ if(variants.size() != 0){
+ for(int i = 0; i != variants.get(0).getScope().length(); ++i) this.addSubItem(this.getTopicRepresentation(variants.get(0).getScope().get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
}
} else {
throw new InvalidGdlSchemaException("The constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " is not suported to be bound to the value group instance " + TmHelper.getAnyIdOfTopic(this.getValueGroup()));
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Thu Oct 20 00:14:01 2011 (r1011)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Thu Oct 20 00:47:07 2011 (r1012)
@@ -21,6 +21,7 @@
public final static String tmclAssociationType = tmcl + "association-type";
public final static String tmclRoleType = tmcl + "role-type";
public final static String tmclConstraint = tmcl + "constraint";
+ public final static String tmclOccurrenceConstraint = tmcl + "occurrence-constraint";
public final static String tmclConstrained = tmcl + "constrained";
public final static String tmclConstrainedStatement = tmcl + "constrained-statement";
public final static String tmclRegularExpressionConstraint = tmcl + "regular-expression-constraint";
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Oct 20 00:14:01 2011 (r1011)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Thu Oct 20 00:47:07 2011 (r1012)
@@ -12,6 +12,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.ScopedStub;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Variant;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
@@ -1498,4 +1499,31 @@
else if(result.size() == 1) return result.get(0);
else return null;
}
+
+
+ // Returns all variants of a topic that satisfies the passed constraint.
+ public static ArrayList<Variant> getVariantsForConstraint(Topic owner, Topic constraint) throws InvalidGdlSchemaException {
+ ArrayList<Variant> result = new ArrayList<Variant>();
+ if(owner == null || constraint == null) return result;
+
+ Topic nameType = TmHelper.getConstrainedStatement(constraint);
+ JsArray<Name> names = owner.getNames(nameType);
+ Topic scope = TmHelper.getConstrainedScopeTopic(constraint);
+
+ for(int nameIdx = 0; nameIdx != names.length(); ++nameIdx){
+ JsArray<Variant> variants = names.get(nameIdx).getVariants();
+ for(int varIdx = 0; varIdx != variants.length(); ++varIdx){
+ if(variants.get(varIdx).getScope().length() != 0){
+ JsArray<Topic> scopes = variants.get(varIdx).getScope();
+ int scopeIdx = 0;
+ for( ; scopeIdx != scopes.length(); ++scopeIdx) if(scopes.get(scopeIdx).equals(scope)) break;
+
+ if(scopeIdx != scopes.length()) result.add(variants.get(varIdx));
+ }
+ }
+ }
+
+ return result;
+ }
+
}
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 Thu Oct 20 00:14:01 2011 (r1011)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Thu Oct 20 00:47:07 2011 (r1012)
@@ -222,12 +222,12 @@
{"subject_identifiers":["[model:service-variant-name-scope-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Scope]"]},
{"subject_identifiers":["[gdlsrv:service-variant-name-iis-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_ii_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
- {"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"430px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"450px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
{"subject_identifiers":["[model:service-variant-name-ii-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Identifiers]"]},
{"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_reifier_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
- {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"470px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"490px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
{"subject_identifiers":["[model:service-variant-name-reifier-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Reifier]"]},
1
0

[isidorus-cvs] r1011 - trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 20 Oct '11
by lgiessmann@common-lisp.net 20 Oct '11
20 Oct '11
Author: lgiessmann
Date: Thu Oct 20 00:14:01 2011
New Revision: 1011
Log:
gdl-frontend: Widgets: implemented the gdlt:Variant-Name-Scope semantics for retrieving data
Modified:
trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
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 Wed Oct 19 12:16:19 2011 (r1010)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Oct 20 00:14:01 2011 (r1011)
@@ -1920,10 +1920,10 @@
// get type
Topic constrainedTopicType = TmHelper.getConstrainedTopicType(this.getConstraint());
-
+
// search for the topic type
Reifiable ref = (Reifiable)this.receivedData;
-
+
// search for the characteristics type
if(this.receivedData instanceof Topic){
JsArray<Name> names = ((Topic)this.receivedData).getNames(constrainedTopicType);
@@ -1937,7 +1937,7 @@
JsArray<Role> roles = ((Association)this.receivedData).getRoles(constrainedTopicType);
if(roles.length() != 0) ref = roles.get(0);
}
-
+
// search for item-identifiers of the found topic type or characteristics
Pattern rex = new Pattern(this.getLiteralValueForConstraint());
for(int i = 0; i != ((ReifiableStub)ref).getItemIdentifiers().length(); ++i){
@@ -1960,7 +1960,7 @@
this.addSubItem(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclReifierConstraint)){
Topic type = TmHelper.getConstrainedStatement(this.getConstraint());
-
+
Topic reifier = null;
if(this.receivedData instanceof Topic){
JsArray<Name> names = ((Topic)this.receivedData).getNames(type);
@@ -1974,30 +1974,33 @@
} 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)){
if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
+
Topic nameType = TmHelper.getConstrainedStatement(this.getRootConstraint());
JsArray<Name> names = ((Topic)this.receivedData).getNames(nameType);
Topic scope = TmHelper.getConstrainedScopeTopic(this.getRootConstraint());
JsArray<Variant> variants = names.get(0).getVariants();
-
- if(variants.get(0).getScope().length() != 0){
- JsArray<Topic> scopes = variants.get(0).getScope();
- int i = 0;
- for( ; i != scopes.length(); ++i) if(scopes.get(i).equals(scope)) break;
-
- if(i != scopes.length()){
- for(i = 0; i != scopes.length(); ++i) this.addSubItem(this.getTopicRepresentation(scopes.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
+
+ for(int varIdx = 0; varIdx != variants.length(); ++varIdx){
+ if(variants.get(varIdx).getScope().length() != 0){
+ JsArray<Topic> scopes = variants.get(varIdx).getScope();
+ int scopeIdx = 0;
+ for( ; scopeIdx != scopes.length(); ++scopeIdx) if(scopes.get(scopeIdx).equals(scope)) break;
+
+ if(scopeIdx != scopes.length()){
+ this.addSubItem(variants.get(varIdx).getValue());
+ break;
+ }
}
}
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclScopeConstraint)){
Topic type = TmHelper.getConstrainedStatement(this.getConstraint());
-
+
JsArray<Topic> scope = null;
if(this.receivedData instanceof Topic){
JsArray<Name> names = ((Topic)this.receivedData).getNames(type);
@@ -2011,7 +2014,7 @@
} else {
throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a topic or association, but is: " + this.receivedData.getClass());
}
-
+
if(scope != null){
for(int i = 0; i != scope.length(); ++i) this.addSubItem(this.getTopicRepresentation(scope.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
}
@@ -2044,7 +2047,7 @@
String constraints = PSIs.TMCL.tmclTopicNameConstraint + ", " + PSIs.TMCL.tmclTopicOccurrenceConstraint + ", " + PSIs.TMCL.tmclTopicRoleConstraint + ", " + PSIs.TMCL.tmclAssociationRoleConstraint;
throw new ExecutionException("The topic " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to the following root constraints: " + constraints);
}
-
+
String str = this.getTopicRepresentation(type, this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup());
if(str == null) str = "";
this.addSubItem(str);
@@ -2055,7 +2058,24 @@
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlVariantNameReifier)){
// TODO: implement: Variant-Name-Reifier
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlVariantNameScope)){
- // TODO: implement: Variant-Name-Scope
+ if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+
+ Topic nameType = TmHelper.getConstrainedStatement(this.getRootConstraint());
+ JsArray<Name> names = ((Topic)this.receivedData).getNames(nameType);
+ Topic scope = TmHelper.getConstrainedScopeTopic(this.getRootConstraint());
+ JsArray<Variant> variants = names.get(0).getVariants();
+
+ for(int varIdx = 0; varIdx != variants.length(); ++varIdx){
+ if(variants.get(varIdx).getScope().length() != 0){
+ JsArray<Topic> scopes = variants.get(varIdx).getScope();
+ int scopeIdx = 0;
+ for( ; scopeIdx != scopes.length(); ++scopeIdx) if(scopes.get(scopeIdx).equals(scope)) break;
+
+ if(scopeIdx != scopes.length()){
+ for(int i = 0; i != scopes.length(); ++i) this.addSubItem(this.getTopicRepresentation(scopes.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
+ }
+ }
+ }
} else {
throw new InvalidGdlSchemaException("The constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " is not suported to be bound to the value group instance " + TmHelper.getAnyIdOfTopic(this.getValueGroup()));
}
1
0

[isidorus-cvs] r1010 - in trunk/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
by lgiessmann@common-lisp.net 19 Oct '11
by lgiessmann@common-lisp.net 19 Oct '11
19 Oct '11
Author: lgiessmann
Date: Wed Oct 19 12:16:19 2011
New Revision: 1010
Log:
gdl-frontend: Widgets: implemented the tmcl:variant-name-constraint semantics for retrieving data
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/PSIs.java
trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm
trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt
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 Wed Oct 19 05:07:18 2011 (r1009)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Oct 19 12:16:19 2011 (r1010)
@@ -1979,7 +1979,22 @@
if(str == null) str = "";
this.addSubItem(str);
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclVariantNameConstraint)){
- // TODO: implement: variant-name-constraint
+ if(!(this.receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
+
+ Topic nameType = TmHelper.getConstrainedStatement(this.getRootConstraint());
+ JsArray<Name> names = ((Topic)this.receivedData).getNames(nameType);
+ Topic scope = TmHelper.getConstrainedScopeTopic(this.getRootConstraint());
+ JsArray<Variant> variants = names.get(0).getVariants();
+
+ if(variants.get(0).getScope().length() != 0){
+ JsArray<Topic> scopes = variants.get(0).getScope();
+ int i = 0;
+ for( ; i != scopes.length(); ++i) if(scopes.get(i).equals(scope)) break;
+
+ if(i != scopes.length()){
+ for(i = 0; i != scopes.length(); ++i) this.addSubItem(this.getTopicRepresentation(scopes.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
+ }
+ }
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclScopeConstraint)){
Topic type = TmHelper.getConstrainedStatement(this.getConstraint());
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Wed Oct 19 05:07:18 2011 (r1009)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/PSIs.java Wed Oct 19 12:16:19 2011 (r1010)
@@ -38,6 +38,7 @@
public final static String tmclAllowed = tmcl + "allowed";
public final static String tmclAllowedReifier = tmcl + "allowed-reifier";
public final static String tmclConstrainedScope = tmcl + "constrained-scope";
+ public final static String tmclConstrainedScopeTopic = tmcl + "constrained-scope-topic";
public final static String tmclSubjectIdentifierConstraint = tmcl + "subject-identifier-constraint";
public final static String tmclSubjectLocatorConstraint = tmcl + "subject-locator-constraint";
public final static String tmclItemIdentifierConstraint = tmcl + "item-identifier-constraint";
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Wed Oct 19 05:07:18 2011 (r1009)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Wed Oct 19 12:16:19 2011 (r1010)
@@ -856,6 +856,21 @@
}
+ // returns a topic that can e used as scope topic
+ public static Topic getConstrainedScopeTopic(Topic constraintTopic) throws InvalidGdlSchemaException{
+ if(constraintTopic == null) return null;
+
+ TopicMap tm = constraintTopic.getTopicMap();
+ Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic constrainedScopeTopicAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedScopeTopic, tm);
+ Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
+ ArrayList<Topic> constrainedScopeTopics = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedScopeTopicAssocType, null, constrainedRoleType);
+
+ if(constrainedScopeTopics.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(constraintTopic) + " must be bound exactly once to a statement topic via a " + PSIs.TMCL.tmclConstrainedScopeTopic + " association, but is: " + constrainedScopeTopics.size());
+ else return constrainedScopeTopics.get(0);
+ }
+
+
// returns the topic that plays the role of tmcl:constrained in an association
// of the type tmcl:constrained-topic-type that is bound to the passed topic
// constraint-Topic that plays the role of tmcl:constraint
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 Wed Oct 19 05:07:18 2011 (r1009)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Wed Oct 19 12:16:19 2011 (r1010)
@@ -225,7 +225,12 @@
{"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"430px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
{"subject_identifiers":["[model:service-variant-name-ii-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Identifiers]"]},
-
+
+ {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_reifier_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"470px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+ {"subject_identifiers":["[model:service-variant-name-reifier-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Reifier]"]},
+
@@ -418,7 +423,13 @@
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-iis-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-scope-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-iis-text]"}]},
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-iis-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-iis-text]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-iis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-ii-constraint]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-ii-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-constraint]"}]}
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-ii-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-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-variant-name-reifier-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-reifier-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-iis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-reifier-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-reifier-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-reifier-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-reifier-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-reifier-constraint]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-reifier-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-constraint]"}]}
Modified: trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Wed Oct 19 05:07:18 2011 (r1009)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Wed Oct 19 12:16:19 2011 (r1010)
@@ -4,15 +4,15 @@
==> item-identifier-constraint ***
==> topic-name-constraint ***
==> regular-expression-constraint ***
- ==> Type **
+ ==> Type ***
==> scope-constraint ***
==> reifier-constraint ***
==> item-identifier-constraint ***
==> variant-name-constraint ***
- ==> Datatype **
- ==> Variant-Name-Scope **
- ==> Variant-Name-Identifiers **
- ==> Variant-Name-Reifier *
+ ==> Datatype ***
+ ==> Variant-Name-Scope ***
+ ==> Variant-Name-Identifiers ***
+ ==> Variant-Name-Reifier ***
==> Endpoint *
1
0

[isidorus-cvs] r1009 - trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets
by lgiessmann@common-lisp.net 19 Oct '11
by lgiessmann@common-lisp.net 19 Oct '11
19 Oct '11
Author: lgiessmann
Date: Wed Oct 19 05:07:18 2011
New Revision: 1009
Log:
gdl-frontend: Widgets: extended the GDL-Test-Schema for variant-names
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.txt
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 Wed Oct 19 03:22:41 2011 (r1008)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Wed Oct 19 05:07:18 2011 (r1009)
@@ -171,7 +171,7 @@
{"subject_identifiers":["[gdlt:Delete-Button]"]},
{"subject_identifiers":["[gdlsrv:service-schema]"], "instance_of":["si:[gdlt:Schema]"], "names":[{"type":"si:[gdl:schema-name]", "value":"GDL Schema for a Service UI"}]},
- {"subject_identifiers":["[gdlsrv:service-default-editor-topic-view]"], "instance_of":["si:[gdlt:Default-Editor-Topic-View]"], "names":[{"type":"si:[gdl:view-name]", "value":"GDL Default Editor Topic View for instances of http://services.org/serviceregistry/model/types/Service"}], "occurrences":[{"type":"si:[gdl:id]", "value":"service_default_editor_topic_view_id"}, {"type":"si:[gdl:width]", "value":"552px"}, {"type":"si:[gdl:height]", "value":"300px"},{"type":"si:[gdl:background-color]", "value":"gray"}]},
+ {"subject_identifiers":["[gdlsrv:service-default-editor-topic-view]"], "instance_of":["si:[gdlt:Default-Editor-Topic-View]"], "names":[{"type":"si:[gdl:view-name]", "value":"GDL Default Editor Topic View for instances of http://services.org/serviceregistry/model/types/Service"}], "occurrences":[{"type":"si:[gdl:id]", "value":"service_default_editor_topic_view_id"}, {"type":"si:[gdl:width]", "value":"552px"}, {"type":"si:[gdl:height]", "value":"800px"},{"type":"si:[gdl:background-color]", "value":"gray"}]},
{"subject_identifiers":["[gdlsrv:service-editor-view-binding]"], "instance_of":["si:[gdlt:TM-Single-Type-Value]"]},
{"subject_identifiers":["[gdlsrv:service-psis-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_psis_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
@@ -207,6 +207,26 @@
{"subject_identifiers":["[gdlsrv:service-name-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"270px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-name-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"310px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-variant-name-dt-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_dt_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-dt-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"350px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-dt-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+ {"subject_identifiers":["[model:service-variant-name-dt-constraint]"], "instance_of":["si:[gdlt:Datatype]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-variant-name-scope-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_scope_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-scope-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"390px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-scope-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+ {"subject_identifiers":["[model:service-variant-name-scope-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Scope]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-variant-name-iis-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_ii_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"430px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+ {"subject_identifiers":["[model:service-variant-name-ii-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Identifiers]"]},
+
+
{"subject_identifiers":["[model:sort-service-name-reifier]"], "instance_of":["si:[types:Reifier-Type]"]},
@@ -375,8 +395,34 @@
{"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-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]"}]}
-
+ {"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]"}]},
+
+ {"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-variant-name-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-name-iis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-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-variant-name-dt-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-dt-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-dt-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-dt-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-dt-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-dt-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-dt-constraint]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-dt-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-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-variant-name-scope-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-scope-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-dt-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-scope-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-scope-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-scope-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-scope-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-scope-constraint]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-scope-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-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-variant-name-iis-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-iis-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-scope-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-iis-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-iis-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-iis-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-iis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-ii-constraint]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-ii-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-constraint]"}]}
+
+
+
+
]
}
\ No newline at end of file
Modified: trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Wed Oct 19 03:22:41 2011 (r1008)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Wed Oct 19 05:07:18 2011 (r1009)
@@ -8,10 +8,10 @@
==> scope-constraint ***
==> reifier-constraint ***
==> item-identifier-constraint ***
- ==> variant-name-constraint * *
- ==> Datatype *
- ==> Variant-Name-Scope *
- ==> Variant-Name-Identifiers *
+ ==> variant-name-constraint ***
+ ==> Datatype **
+ ==> Variant-Name-Scope **
+ ==> Variant-Name-Identifiers **
==> Variant-Name-Reifier *
1
0

[isidorus-cvs] r1008 - in trunk/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
by lgiessmann@common-lisp.net 19 Oct '11
by lgiessmann@common-lisp.net 19 Oct '11
19 Oct '11
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]"}]}
1
0

[isidorus-cvs] r1007 - trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 18 Oct '11
by lgiessmann@common-lisp.net 18 Oct '11
18 Oct '11
Author: lgiessmann
Date: Tue Oct 18 07:39:38 2011
New Revision: 1007
Log:
gdl-frontend: Widgets: implemented the tmcl:scope-constraint semantics for retrieving data
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/TmHelper.java
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 05:10:29 2011 (r1006)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Tue Oct 18 07:39:38 2011 (r1007)
@@ -1963,7 +1963,26 @@
} 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: scope-constraint
+ // 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){
+ JsArray<Occurrence> occs = ((Topic)this.receivedData).getOccurrences(type);
+ if(occs.length() != 0) scope = occs.get(0).getScope();
+ }
+ } 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());
+ }
+
+ if(scope != null){
+ for(int i = 0; i != scope.length(); ++i) this.addSubItem(this.getTopicRepresentation(scope.get(i), this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup()));
+ }
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlRolePlayer)){
if(!(receivedData instanceof Association)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to an Association, but is: " + receivedData.getClass());
if(this.getRootConstraint() == null || !TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicRoleConstraint)) throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a root constraint of the type " + PSIs.TMCL.tmclTopicRoleConstraint + ", but ist bound to the root topic: " + (this.getRootConstraint() == null ? "null" : TmHelper.getAnyIdOfTopic(this.getRootConstraint())));
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Tue Oct 18 05:10:29 2011 (r1006)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Tue Oct 18 07:39:38 2011 (r1007)
@@ -20,9 +20,7 @@
import us.isidor.gdl.anaToMia.Widgets.view.GdlTopicView;
import us.isidor.gdl.anaToMia.Widgets.view.GdlAssociationView.AssociationItem;
import us.isidor.gdl.anaToMia.Widgets.view.GdlView;
-
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.user.client.Window;
public class TmHelper {
@@ -181,7 +179,6 @@
JsArray<Role> validRoles = top.getRolesPlayed(subtype, supertypeSubtype);
for(int i = 0; i != validRoles.length(); ++i){
Association parent = validRoles.get(i).getParent();
- Window.alert(">> " + parent.getRoles().length() + " >> " + parent.getRoles(supertype).length());
if(parent.getRoles().length() == 2 && parent.getRoles(supertype).length() == 1)result.add(parent.getRoles(supertype).get(0).getPlayer());
}
return result;
1
0

[isidorus-cvs] r1006 - in trunk/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
by lgiessmann@common-lisp.net 18 Oct '11
by lgiessmann@common-lisp.net 18 Oct '11
18 Oct '11
Author: lgiessmann
Date: Tue Oct 18 05:10:29 2011
New Revision: 1006
Log:
gdl-frontend: Widgets: implemented the gdlt:Type semantics for retrieving data
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/TmHelper.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 03:19:08 2011 (r1005)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Tue Oct 18 05:10:29 2011 (r1006)
@@ -2,9 +2,6 @@
import java.util.ArrayList;
-
-import org.apache.commons.codec.language.RefinedSoundex;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
@@ -1979,7 +1976,27 @@
}
}
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlType)){
- // TODO: implement: Type
+ Topic type = null;
+ if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicNameConstraint)){
+ if(!(this.receivedData instanceof Topic)) throw new ExecutionException("The constraints " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " and " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " are only valid when a topic is processed, but is: " + this.receivedData.getClass());
+ type = TmHelper.getConstrainedStatement(this.getRootConstraint());
+ } else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicOccurrenceConstraint)){
+ if(!(this.receivedData instanceof Topic)) throw new ExecutionException("The constraints " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " and " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " are only valid when a topic is processed, but is: " + this.receivedData.getClass());
+ type = TmHelper.getConstrainedStatement(this.getRootConstraint());
+ } else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicRoleConstraint)){
+ if(!(this.receivedData instanceof Association)) throw new ExecutionException("The constraints " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " and " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " are only valid when an association is processed, but is: " + this.receivedData.getClass());
+ type = TmHelper.getConstrainedStatement(this.getRootConstraint());
+ } else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclAssociationRoleConstraint)){
+ if(!(this.receivedData instanceof Association)) throw new ExecutionException("The constraints " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " and " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " are only valid when an association is processed, but is: " + this.receivedData.getClass());
+ type = TmHelper.getConstraintRoleOfConstraint(this.getRootConstraint());
+ } else {
+ String constraints = PSIs.TMCL.tmclTopicNameConstraint + ", " + PSIs.TMCL.tmclTopicOccurrenceConstraint + ", " + PSIs.TMCL.tmclTopicRoleConstraint + ", " + PSIs.TMCL.tmclAssociationRoleConstraint;
+ throw new ExecutionException("The topic " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to the following root constraints: " + constraints);
+ }
+
+ String str = this.getTopicRepresentation(type, this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup());
+ if(str == null) str = "";
+ this.addSubItem(str);
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlDatatype)){
// TODO: implement: Datatype
} else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlVariantNameIdentifiers)){
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Tue Oct 18 03:19:08 2011 (r1005)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Tue Oct 18 05:10:29 2011 (r1006)
@@ -22,6 +22,7 @@
import us.isidor.gdl.anaToMia.Widgets.view.GdlView;
import com.google.gwt.core.client.JsArray;
+import com.google.gwt.user.client.Window;
public class TmHelper {
@@ -180,6 +181,7 @@
JsArray<Role> validRoles = top.getRolesPlayed(subtype, supertypeSubtype);
for(int i = 0; i != validRoles.length(); ++i){
Association parent = validRoles.get(i).getParent();
+ Window.alert(">> " + parent.getRoles().length() + " >> " + parent.getRoles(supertype).length());
if(parent.getRoles().length() == 2 && parent.getRoles(supertype).length() == 1)result.add(parent.getRoles(supertype).get(0).getPlayer());
}
return result;
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 03:19:08 2011 (r1005)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Tue Oct 18 05:10:29 2011 (r1006)
@@ -116,6 +116,10 @@
{"subject_identifiers":["[gdlt:Descriptor]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[gdlt:Visible-Object]"]},
{"subject_identifiers":["[gdlt:Type]"]},
+ {"subject_identifiers":["[gdlt:Datatype]"]},
+ {"subject_identifiers":["[gdlt:Variant-Name-Scope]"]},
+ {"subject_identifiers":["[gdlt:Variant-Name-Identifiers]"]},
+ {"subject_identifiers":["[gdlt:Variant-Name-Reifier]"]},
{"subject_identifiers":["[gdl:id]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:padding-left]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:border-style]"], "instance_of":["si:[tmcl:occurrence-type]"]},
@@ -225,6 +229,30 @@
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[tmcl:constraint]"},{"type":"si:[tmdm:subtype]", "player":"si:[tmcl:variant-name-constraint]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[types:Scope-Type]"},{"type":"si:[tmdm:subtype]", "player":"si:[types:Language]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[types:Scope-Type]"},{"type":"si:[tmdm:subtype]", "player":"si:[types:Priority]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Visible-Object]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:View]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:View]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Topic-View]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Topic-View]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Default-Topic-View]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Default-Topic-View]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Default-Editor-Topic-View]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Descriptor]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:TM-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Literal-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Default-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:TM-Single-Type-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:TM-Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Default-Literal-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Literal-Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Default-Literal-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Default-Value]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Text-Object]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Text]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Position]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value-Group]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Button]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Button]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Action-Button]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Action-Button]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Delete-Button]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Type]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Datatype]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Variant-Name-Scope]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Variant-Name-Identifiers]"}]},
+ {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Variant-Name-Reifier]"}]},
{"type":"si:[tmcl:constrained-topic-type]", "roles":[{"type":"si:[tmcl:constraint]", "player":"si:[model:service-psi-constraint]"},{"type":"si:[tmcl:constrained]", "player":"si:[types:Service]"}]},
1
0

[isidorus-cvs] r1005 - trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base
by lgiessmann@common-lisp.net 18 Oct '11
by lgiessmann@common-lisp.net 18 Oct '11
18 Oct '11
Author: lgiessmann
Date: Tue Oct 18 03:19:08 2011
New Revision: 1005
Log:
gdl-frontend: Widgets: implemented the item-identifier-constraints for associations and association roles
Modified:
trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
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 03:17:10 2011 (r1004)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Tue Oct 18 03:19:08 2011 (r1005)
@@ -1936,6 +1936,9 @@
JsArray<Occurrence> occs = ((Topic)this.receivedData).getOccurrences(constrainedTopicType);
if(occs.length() != 0) ref = occs.get(0);
}
+ } else if(this.receivedData instanceof Association){
+ JsArray<Role> roles = ((Association)this.receivedData).getRoles(constrainedTopicType);
+ if(roles.length() != 0) ref = roles.get(0);
}
// search for item-identifiers of the found topic type or characteristics
1
0

[isidorus-cvs] r1004 - in trunk/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
by lgiessmann@common-lisp.net 18 Oct '11
by lgiessmann@common-lisp.net 18 Oct '11
18 Oct '11
Author: lgiessmann
Date: Tue Oct 18 03:17:10 2011
New Revision: 1004
Log:
gdl-frontend: Widgets: implemented the item-identifier-constraints for occurrences and names
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/TmHelper.java
trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm
trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt
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 Mon Oct 17 08:41:37 2011 (r1003)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Tue Oct 18 03:17:10 2011 (r1004)
@@ -2,6 +2,9 @@
import java.util.ArrayList;
+
+import org.apache.commons.codec.language.RefinedSoundex;
+
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
@@ -111,21 +114,21 @@
protected boolean cardMaxSet = false;
protected ArrayList<Topic> rawTmValues = new ArrayList<Topic>();
protected boolean rawTmValuesSet = false;
-
+
// some constructors
protected GdlVisibleObject() {
initWidget(this.mainPanel);
DOM.setStyleAttribute(this.mainPanel.getElement(), "overflow", "visible");
}
-
+
public GdlVisibleObject(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{
this();
this.tmRepresentative = tmRepresentative;
this.tm = this.tmRepresentative.getTopicMap();
this.gdlParent = gdlParent;
-
+
if(!(receivedData instanceof Topic) && !(receivedData instanceof Association) && !(receivedData instanceof Name) && !(receivedData instanceof Variant) && !(receivedData instanceof Occurrence) && !(receivedData instanceof Role) && receivedData != null) throw new ExecutionException("receivedData must be either a Topic, Association, Topic-Name, Name-Variant, Topic-Occurrence or Association-Role, but is: " + receivedData.getClass());
this.receivedData = receivedData;
@@ -133,46 +136,46 @@
this.setGdlStyle();
}
-
+
public GdlVisibleObject getGdlParent(){
return this.gdlParent;
}
-
-
+
+
public int getSubElementsCount(){
if(this.subElements == null) return 0;
return this.subElements.size();
}
-
-
+
+
public GdlPanel getRoot(){
return this.getGdlParent().getRoot();
}
-
-
+
+
// this method takes a string and creates a new sub-element within
// an instance of GdlVisibleObject with the passed string value
public abstract void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException;
-
+
// returns the topic that represents this element
public Topic getTmRepresentative(){
return this.tmRepresentative;
}
-
-
+
+
// sets all info elements as defined in the GDL
public void setInfoElements() throws InvalidGdlSchemaException, ExecutionException{
ArrayList<Topic> infos = TmHelper.topicContainsInfo(this.tmRepresentative);
-
+
for (Topic info : infos){
GdlInfo elem = (GdlInfo)GdlInstantiator.instantiate(info, this.receivedData, this);
this.infoElements.add(elem);
elem.setPosition(this);
}
}
-
-
+
+
// this method should be invoked if a new sub-element is added to this instance
protected ButtonableObject addToContainerPanel(Widget widget) throws ExecutionException, InvalidGdlSchemaException{
this.setContentOrientation(this.getContentOrientation());
@@ -182,8 +185,8 @@
this.setNthButtons();
return btn;
}
-
-
+
+
// removes the passed widget, it's parent, and returns the parent
protected ButtonableObject removeFromContainer(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
for (Widget elem : this.subElements) {
@@ -194,31 +197,31 @@
}
}
this.setNthButtons();
-
+
return null;
}
-
-
+
+
// sets all buttons in the sub-elements that are specified by a
// gdl:button-position association
protected void setNthButtons() throws InvalidGdlSchemaException, ExecutionException {
if(this.actionButtonsAndPositions == null) this.actionButtonsAndPositions = TmHelper.topicContainsNthButtons(this.tmRepresentative);
-
+
for(int i = 0; i != this.subElements.size(); ++i){
// search all buttons for the current sub element
ArrayList<Topic> currentButtons = new ArrayList<Topic>();
for (Pair<Topic, Integer> pair : this.actionButtonsAndPositions)
if(pair.getSecond() == i || (i == this.subElements.size() -1 && pair.getSecond() == -1)) currentButtons.add(pair.getFirst());
-
+
// remove buttons that do not belong to the current sub element anymore
((ButtonableObject)this.subElements.get(i)).removeObsoleteButtons(currentButtons);
-
+
// add buttons that are not bound to the current sub element, but belong to it
for (Topic currentButton : currentButtons)
if(!((ButtonableObject)this.subElements.get(i)).containsButton(currentButton)) ((ButtonableObject)this.subElements.get(i)).addButton((GdlActionButton)GdlInstantiator.instantiate(currentButton, null, this));
}
}
-
+
// a helper method that returns all occurrences of the type bound to the passed PSI
@SuppressWarnings("unchecked")
@@ -293,7 +296,7 @@
// If no gdl:display occurrence is set, the default value is returned
public Display getDisplay() throws InvalidGdlSchemaException {
Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlDisplay);
-
+
if(displayOcc != null){
String value = displayOcc.getValue().toLowerCase();
if(value.equals("none")){
@@ -329,7 +332,7 @@
// this property if no gdl:float occurrence is available
public Float getFloat() throws InvalidGdlSchemaException {
Occurrence floatOcc = getNoneOrOneUnscopedOccurrence(PSIs.GDL.OccurrenceType.gdlFloat);
-
+
if(floatOcc != null){
String value = floatOcc.getValue().toLowerCase();
if(value.equals("none")){
@@ -345,8 +348,8 @@
return Float.NONE;
}
}
-
-
+
+
// returns a ClearValue instance of a gdl:clear occurrence or the default value for
// this property if no gdl:clear occurrence is available
public ClearValue getClear() throws InvalidGdlSchemaException {
@@ -362,8 +365,8 @@
return ClearValue.NONE;
}
}
-
-
+
+
// returns a ContentOrientationValue instance of a gdl:content-orientation occurrence or the default value for
// this property if no gdl:content-orientation occurrence is available
public ContentOrientationValue getContentOrientation() throws InvalidGdlSchemaException {
@@ -379,8 +382,8 @@
return ContentOrientationValue.VERTICAL;
}
}
-
-
+
+
// returns a VerticalAlign instance of a gdl:vertical-align occurrence
// or the default value for this property if no gdl:vertical-align occurrence
// is available. The styleClass attribute is used as scope for expressing
@@ -1225,7 +1228,7 @@
}
}
-
+
// sets the id property of this element by using the GWT DOM class
public void setId(String id){
if(id != null){
@@ -1258,16 +1261,16 @@
DOM.setStyleAttribute(this.mainPanel.getElement(), "styleFloat", value.getCssName());
}
}
-
-
+
+
// sets the float style property of all sub elements by using the GWT DOM class
public void setContentOrientation(ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
if(value == ContentOrientationValue.HORIZONTAL && this.containerPanel == null) this.containerPanel = new HorizontalPanel();
else if(this.containerPanel == null) this.containerPanel = new VerticalPanel();
-
+
this.mainPanel.add(this.containerPanel);
}
-
+
// sets the clear style property of this element by using the GWT DOM class
public void setClear(ClearValue value){
@@ -1275,7 +1278,7 @@
DOM.setStyleAttribute(this.mainPanel.getElement(), "clear", value.getCssValue());
}
}
-
+
// sets the vertical-align style property of this element and all it's sub-elements by using the GWT DOM class
public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
@@ -1284,7 +1287,7 @@
}
}
-
+
// sets the margin style property of this element by using the GWT DOM class
public void setMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "margin", value.getCssValue());
@@ -1313,8 +1316,8 @@
public void setMarginLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "marginLeft", value.getCssValue());
}
-
-
+
+
// sets the border-color style property of this element by using the GWT DOM class
public void setBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "borderColor", value.getCssValue());
@@ -1343,8 +1346,8 @@
public void setBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "borderLeftColor", value.getCssValue());
}
-
-
+
+
// sets the border-style style property of this element by using the GWT DOM class
public void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "borderStyle", value.getCssValue());
@@ -1374,7 +1377,7 @@
if(value != null) this.setCssProperty(widget, styleClass, "borderLeftStyle", value.getCssValue());
}
-
+
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "borderWidth", value.getCssValue());
@@ -1402,8 +1405,8 @@
public void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "borderLeftWidth", value.getCssValue());
}
-
-
+
+
// sets the border-radius style property of this element by using the GWT DOM class
public void setBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "borderRadius", value.getCssValue());
@@ -1432,8 +1435,8 @@
public void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "borderTopLeftRadius", value.getCssValue());
}
-
-
+
+
// sets the padding style property of this element by using the GWT DOM class
public void setPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "padding", value.getCssValue());
@@ -1462,8 +1465,8 @@
public void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "paddingLeft", value.getCssValue());
}
-
-
+
+
// sets the width style property of this element by using the GWT DOM class
public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "width", value.getCssValue());
@@ -1498,8 +1501,8 @@
public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "maxHeight", value.getCssValue());
}
-
-
+
+
// sets the cursor style property of this element by using the GWT DOM class
public void setCursor(Widget widget, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "cursor", value.getCssValue());
@@ -1510,8 +1513,8 @@
public void setBackgroundColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "backgroundColor", value.getCssValue());
}
-
-
+
+
// sets the passed css style porperty to the passed css value.
// If a styleClass is given, the style is applied to either active, hover or focus
protected void setCssProperty(String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
@@ -1530,12 +1533,12 @@
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
-
-
+
+
// sets a given css property and css value of this element's sub element
protected void setCssProperty(Widget elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
if(cssValue == null || cssProperty == null) return;
-
+
if(styleClass == null){
DOM.setStyleAttribute(elem.getElement(), cssProperty, cssValue);
} else if(styleClass.equals(PSIs.GDL.Scope.gdlActive)){
@@ -1549,12 +1552,12 @@
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
-
-
+
+
// sets a given css property and css value of this element's sub element
protected void setCssProperty(Element elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
if(cssValue == null || cssProperty == null) return;
-
+
if(styleClass == null){
DOM.setStyleAttribute(elem, cssProperty, cssValue);
} else if(styleClass.equals(PSIs.GDL.Scope.gdlActive)){
@@ -1568,64 +1571,64 @@
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
-
-
+
+
// sets all GDL styles that are defined by the topic map representative to tha passed widget
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
String[] styleClasses = new String[]{null, PSIs.GDL.Scope.gdlActive, PSIs.GDL.Scope.gdlFocus, PSIs.GDL.Scope.gdlHover};
for (String styleClass : styleClasses) {
this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
-
+
this.setMargin(widget, this.getMargin(styleClass), styleClass);
this.setMarginTop(widget, this.getMarginTop(styleClass), styleClass);
this.setMarginRight(widget, this.getMarginRight(styleClass), styleClass);
this.setMarginBottom(widget, this.getMarginBottom(styleClass), styleClass);
this.setMarginLeft(widget, this.getMarginLeft(styleClass), styleClass);
-
+
this.setPadding(widget, this.getPadding(styleClass), styleClass);
this.setPaddingTop(widget, this.getPaddingTop(styleClass), styleClass);
this.setPaddingRight(widget, this.getPaddingRight(styleClass), styleClass);
this.setPaddingBottom(widget, this.getPaddingBottom(styleClass), styleClass);
this.setPaddingLeft(widget, this.getPaddingLeft(styleClass), styleClass);
-
+
this.setBorderColor(widget, this.getBorderColor(styleClass), styleClass);
this.setBorderTopColor(widget, this.getBorderTopColor(styleClass), styleClass);
this.setBorderRightColor(widget, this.getBorderRightColor(styleClass), styleClass);
this.setBorderBottomColor(widget, this.getBorderBottomColor(styleClass), styleClass);
this.setBorderLeftColor(widget, this.getBorderLeftColor(styleClass), styleClass);
-
+
this.setBorderStyle(widget, this.getBorderStyle(styleClass), styleClass);
this.setBorderTopStyle(widget, this.getBorderTopStyle(styleClass), styleClass);
this.setBorderRightStyle(widget, this.getBorderRightStyle(styleClass), styleClass);
this.setBorderBottomStyle(widget, this.getBorderBottomStyle(styleClass), styleClass);
this.setBorderLeftStyle(widget, this.getBorderLeftStyle(styleClass), styleClass);
-
+
this.setBorderWidth(widget, this.getBorderWidth(styleClass), styleClass);
this.setBorderTopWidth(widget, this.getBorderTopWidth(styleClass), styleClass);
this.setBorderRightWidth(widget, this.getBorderRightWidth(styleClass), styleClass);
this.setBorderBottomWidth(widget, this.getBorderBottomWidth(styleClass), styleClass);
this.setBorderLeftWidth(widget, this.getBorderLeftWidth(styleClass), styleClass);
-
+
this.setBorderRadius(widget, this.getBorderRadius(styleClass), styleClass);
this.setBorderTopRightRadius(widget, this.getBorderTopRightRadius(styleClass), styleClass);
this.setBorderBottomRightRadius(widget, this.getBorderBottomRightRadius(styleClass), styleClass);
this.setBorderBottomLeftRadius(widget, this.getBorderBottomLeftRadius(styleClass), styleClass);
this.setBorderTopLeftRadius(widget, this.getBorderTopLeftRadius(styleClass), styleClass);
-
+
this.setCursor(widget, this.getCursor(styleClass), styleClass);
-
+
this.setWidth(widget, this.getWidth(styleClass), styleClass);
this.setMaxWidth(widget, this.getMaxWidth(styleClass), styleClass);
this.setMinWidth(widget, this.getMinWidth(styleClass), styleClass);
-
+
this.setHeight(widget, this.getHeight(styleClass), styleClass);
this.setMaxHeight(widget, this.getMaxHeight(styleClass), styleClass);
this.setMinHeight(widget, this.getMinHeight(styleClass), styleClass);
-
+
this.setBackgroundColor(widget, this.getBackgroundColor(styleClass), styleClass);
}
}
-
+
// sets all GDL styles that are defined by the topic map representative
protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
@@ -1679,8 +1682,8 @@
}
return regs;
}
-
-
+
+
// registers a mouse-down handler to all sub-elements of this element
@Override
public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
@@ -1690,8 +1693,8 @@
}
return regs;
}
-
-
+
+
// registers a mouse-up handler to all sub-elements of this element
@Override
public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
@@ -1701,9 +1704,9 @@
}
return regs;
}
-
-
-
+
+
+
// registers a blur handler to all sub-elements of this element
@Override
public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
@@ -1713,12 +1716,12 @@
}
return regs;
}
-
-
+
+
// adds the passed handler to the list eventHandlers
protected void addEventHandler(Widget elem, EventHandler handler){
if(handler == null || elem == null) return;
-
+
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
if(!item.getSecond().contains(handler)){
@@ -1731,8 +1734,8 @@
newHandlerList.add(handler);
this.eventHandlers.add(new Pair<Widget, ArrayList<EventHandler>>(elem, newHandlerList));
}
-
-
+
+
// remove the passed handler of the list eventHandlers
protected void removeEventHandler(Widget elem, EventHandler handler){
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
@@ -1741,8 +1744,8 @@
}
}
}
-
-
+
+
// returns the last handler bound to the passed element.
protected EventHandler getLastHandler(Widget elem){
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
@@ -1753,35 +1756,35 @@
}
}
}
-
+
return null;
}
-
-
+
+
// applies the styles bound to hover and the passed element
protected void onHoverStart(Widget widget){
for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
}
-
-
+
+
// applies the styles bound to acitve and the passed element
protected void onActiveStart(Widget widget){
for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
}
-
-
+
+
// applies the styles bound to focus and the passed element
protected void onFocusStart(Widget widget){
for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
}
-
-
+
+
// some handler for applying the css style bound to the pseudo classes hover, active and focus
public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
Widget source = (Widget)event.getSource();
@@ -1791,7 +1794,7 @@
}
}
-
+
// shall be called when the focus event was fired
public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
try{
@@ -1809,7 +1812,7 @@
e.printStackTrace();
}
}
-
+
// shall be called to apply the styles of the focus class
public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
@@ -1838,7 +1841,7 @@
}
}
-
+
// shall be called to apply the styles of the active class
public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
Widget source = (Widget)event.getSource();
@@ -1865,16 +1868,16 @@
Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
}
}
-
-
+
+
// removes all GdlInfo elements. They must be remove explicitly, since they are
// bound to the root panel/body
public void clear(){
for (GdlInfo elem : this.infoElements)
elem.removeFromParent();
}
-
-
+
+
@Override
public void onAttach(){
super.onAttach();
@@ -1884,20 +1887,20 @@
e.printStackTrace();
}
}
-
-
+
+
// if this method is called the user cannot change the represented value
// of this control
public abstract void fixValue();
-
-
+
+
// sets the fields for the received data
protected void setReceivedData() throws InvalidGdlSchemaException, ExecutionException {
-if(receivedData == null) return;
-
+ if(receivedData == null) return;
+
if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclSubjectIdentifierConstraint)){
if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
+
Pattern rex = new Pattern(this.getLiteralValueForConstraint());
for(int i = 0; i != ((Topic)receivedData).getSubjectIdentifiers().length(); ++i){
String psi = ((Topic)receivedData).getSubjectIdentifiers().get(i).getReference();
@@ -1907,7 +1910,7 @@
}
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclSubjectLocatorConstraint)){
if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
+
Pattern rex = new Pattern(this.getLiteralValueForConstraint());
for(int i = 0; i != ((Topic)receivedData).getSubjectLocators().length(); ++i){
String sl = ((Topic)receivedData).getSubjectLocators().get(i).getReference();
@@ -1917,23 +1920,41 @@
}
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclItemIdentifierConstraint)){
if(!(this.receivedData instanceof Reifiable)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Reifiable, but is: " + receivedData.getClass());
+
+ // get type
+ Topic constrainedTopicType = TmHelper.getConstrainedTopicType(this.getConstraint());
+
+ // search for the topic type
+ Reifiable ref = (Reifiable)this.receivedData;
+ // search for the characteristics type
+ if(this.receivedData instanceof Topic){
+ JsArray<Name> names = ((Topic)this.receivedData).getNames(constrainedTopicType);
+ if(names.length() != 0){
+ ref = names.get(0);
+ } else {
+ JsArray<Occurrence> occs = ((Topic)this.receivedData).getOccurrences(constrainedTopicType);
+ if(occs.length() != 0) ref = occs.get(0);
+ }
+ }
+
+ // search for item-identifiers of the found topic type or characteristics
Pattern rex = new Pattern(this.getLiteralValueForConstraint());
- for(int i = 0; i != ((ReifiableStub)receivedData).getItemIdentifiers().length(); ++i){
- String ii = ((Topic)receivedData).getItemIdentifiers().get(i).getReference();
+ for(int i = 0; i != ((ReifiableStub)ref).getItemIdentifiers().length(); ++i){
+ String ii = ((ReifiableStub)ref).getItemIdentifiers().get(i).getReference();
if(rex.matches(ii)){
this.addSubItem(ii);
}
}
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclTopicNameConstraint)){
if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
+
Topic nameType = TmHelper.getConstrainedStatement(this.getConstraint());
for(int i = 0; i != ((Topic)this.receivedData).getNames(nameType).length(); ++i)
this.addSubItem(((Topic)this.receivedData).getNames(nameType).get(i).getValue());
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclTopicOccurrenceConstraint)){
if(!(receivedData instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a Topic, but is: " + receivedData.getClass());
-
+
Topic occurrenceType = TmHelper.getConstrainedStatement(this.getConstraint());
for(int i = 0; i != ((Topic)this.receivedData).getOccurrences(occurrenceType).length(); ++i)
this.addSubItem(((Topic)this.receivedData).getOccurrences(occurrenceType).get(i).getValue());
@@ -1946,7 +1967,7 @@
} else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlRolePlayer)){
if(!(receivedData instanceof Association)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to an Association, but is: " + receivedData.getClass());
if(this.getRootConstraint() == null || !TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicRoleConstraint)) throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to a root constraint of the type " + PSIs.TMCL.tmclTopicRoleConstraint + ", but ist bound to the root topic: " + (this.getRootConstraint() == null ? "null" : TmHelper.getAnyIdOfTopic(this.getRootConstraint())));
-
+
Pair<Topic, Topic> roleAndPlayerType = TmHelper.getConstrainedRoleAndPlayerTypeOfConstraint(this.getRootConstraint());
JsArray<Role> assocRoles = ((Association)this.receivedData).getRoles(roleAndPlayerType.getFirst());
for(int i = 0; i != assocRoles.length(); ++i){
@@ -1968,26 +1989,26 @@
throw new InvalidGdlSchemaException("The constraint " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " is not suported to be bound to the value group instance " + TmHelper.getAnyIdOfTopic(this.getValueGroup()));
}
}
-
-
+
+
// sets the field for the set default value or sets at least one empty field (card-min)
protected void setDefaultValue() throws InvalidGdlSchemaException, ExecutionException {
if(this.getDefaultLiteralValue() != null && this.getDefaultTmValue() != null) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getValueGroup()) + " must be bound to maximal one " + PSIs.GDL.TopicType.gdlDefaultValue + ", but is: 2");
-
+
if(this.getDefaultLiteralValue() != null){
TopicMap tm = this.getDefaultLiteralValue().getTopicMap();
Topic occType = TmHelper.getTopicByPsi(PSIs.GDL.OccurrenceType.gdlLiteralValue, tm);
JsArray<Occurrence> vals = this.getDefaultLiteralValue().getOccurrences(occType);
-
+
if(vals.length() != 1) throw new InvalidGdlSchemaException("the topic " + TmHelper.getAnyIdOfTopic(this.getDefaultLiteralValue()) + " must be bound exactly once to a " + PSIs.GDL.OccurrenceType.gdlLiteralValue + " occurrence, but is: " + vals.length());
-
+
int minValues = this.getCardMin() == 0 ? 1 : this.getCardMin();
for(int i = 0; i < minValues; ++i)
this.addSubItem(vals.get(0).getValue());
if(this.fixedDefaultValue()) this.fixValue();
} else if(this.getDefaultTmValue() != null){
ArrayList<Topic> values = TmHelper.getValuesForTmValue(this.getDefaultTmValue());
-
+
if(values.size() != 1) throw new InvalidGdlSchemaException("the default value " + TmHelper.getAnyIdOfTopic(this.getDefaultValue()) + " represetns more than one value");
int minValues = this.getCardMin() == 0 ? 1 : this.getCardMin();
@@ -1998,8 +2019,8 @@
this.addSubItem("");
}
}
-
-
+
+
public int getCardMin() throws InvalidGdlSchemaException {
if(this.cardMinSet){
return this.cardMin;
@@ -2008,8 +2029,8 @@
return TmHelper.getCardMin(this.getRootConstraint());
}
}
-
-
+
+
public int getCardMax() throws InvalidGdlSchemaException {
if(this.cardMaxSet){
return this.cardMax;
@@ -2018,8 +2039,8 @@
return TmHelper.getCardMax(this.getRootConstraint());
}
}
-
-
+
+
// returns the topic instance of gdlt:Value-Group that is bound to this
// visible element, or null if it is unbound
public Topic getValueGroup() throws InvalidGdlSchemaException {
@@ -2044,8 +2065,8 @@
return this.constraintTopic;
}
}
-
-
+
+
// returns the root (last) constraint that is bound to the value-group
// of this element - or null if it is unbound
public Topic getRootConstraint() throws InvalidGdlSchemaException {
@@ -2083,8 +2104,8 @@
return this.defaultLiteralValueTopic;
}
}
-
-
+
+
// returns the topic that represents the default value of
// the value-group that is bound to this element - null if it is unbound
public Topic getDefaultValue() throws InvalidGdlSchemaException {
@@ -2093,17 +2114,17 @@
else return this.getDefaultTmValue();
}
-
+
// returns true if the default value is fixed
// otherwise the return value is false
public boolean fixedDefaultValue() throws InvalidGdlSchemaException{
Topic defVal = this.getDefaultValue();
-
+
if(defVal == null) return false;
-
+
TopicMap tm = defVal.getTopicMap();
Occurrence fixedOcc = TmHelper.getSingleOccurrence(defVal, TmHelper.getTopicByPsi(PSIs.GDL.OccurrenceType.gdlFixed, tm));
-
+
if(fixedOcc != null){
try{
return Boolean.valueOf(fixedOcc.getValue().toLowerCase());
@@ -2114,7 +2135,7 @@
return false;
}
}
-
+
// returns all topic maps values represented by topics of the type gdlt:Tm-Value
// that are valid and declared for the value-group of this element - or
@@ -2142,7 +2163,7 @@
}
}
-
+
// returns an ArrayList of strings that are set to a value group as literal values
public ArrayList<String> getLiterals() throws InvalidGdlSchemaException {
if(this.literalsSet){
@@ -2153,7 +2174,7 @@
return this.literals;
}
}
-
+
// returns the set literal value or null
public String getSetLiteralValue() throws InvalidGdlSchemaException {
@@ -2195,14 +2216,14 @@
}
}
-
+
// returns the display-by schema that is defined for the passed
// TM-Value that is bound to this element
public Topic getDisplayByOfTmValue(Topic tmValue) throws InvalidGdlSchemaException{
return TmHelper.getDisplayByTopicOf(tmValue);
}
-
-
+
+
// returns the preferred scope that is bound to the value-group of
// this element - or an empty ArrayList
public ArrayList<Topic> getPreferredScopeOfValueGroup() throws InvalidGdlSchemaException {
@@ -2215,26 +2236,26 @@
}
}
-
+
// returns the preferred scope that is bound to the passed TM-Value topic
// this element - or an empty ArrayList
public ArrayList<Topic> getPreferredScopeOfTmValue(Topic tmValue) throws InvalidGdlSchemaException{
return TmHelper.getPrefferedScopesForTopicOf(tmValue);
}
-
+
// returns the string that represents the topic topicToRepresent corresponding
// to the passed displayBy and prefferedScopes arguments
public String getTopicRepresentation(Topic topicToRepresent, Topic displayBy, ArrayList<Topic> preferredScopes) throws InvalidGdlSchemaException {
return TmHelper.getTopicRepresentation(topicToRepresent, displayBy, preferredScopes);
}
-
-
+
+
// returns the strings of the control that are entered/selected
// returns the strings of the control that are entered/selected
public abstract ArrayList<String> getSelectedValues();
-
-
+
+
// validates names, occurrences and identifiers for tha passed value
private void validateLiteralValue(String selectedValue) throws InvalidContentException, InvalidGdlSchemaException{
ArrayList<Pattern> validLiteralValues = new ArrayList<Pattern>();
@@ -2242,21 +2263,21 @@
if(validLiteralValues.size() == 0) validLiteralValues.add(new Pattern(this.getLiteralValueForConstraint()));
int i = 0;
for( ; i != validLiteralValues.size(); ++i) if(validLiteralValues.get(i).matches(selectedValue)) break;
-
+
if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicNameConstraint)){
if(i == validLiteralValues.size()) throw new InvalidContentException("the user data " + selectedValue + " for the topic-name " + TmHelper.getAnyIdOfTopic(TmHelper.getConstrainedStatement(this.getConstraint())) + " does not satisfy any of the constraints: " + Utils.arrayToString(validLiteralValues));
} else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicOccurrenceConstraint)){
if(i == validLiteralValues.size()) throw new InvalidContentException("the user data " + selectedValue + " for the topic-occurrence " + TmHelper.getAnyIdOfTopic(TmHelper.getConstrainedStatement(this.getConstraint())) + " does not satisfy any of the constraints: " + Utils.arrayToString(validLiteralValues));
} else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclSubjectIdentifierConstraint)){
-
+
} else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclSubjectLocatorConstraint)){
-
+
} else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclItemIdentifierConstraint)){
-
+
}
}
-
-
+
+
// validates the the tm values of a constraint
private void validateTmValue(Topic selectedPlayer) throws InvalidContentException, InvalidGdlSchemaException, ExecutionException {
if(this.getRawTmValues().size() != 0 && !this.getRawTmValues().contains(selectedPlayer)){
@@ -2267,9 +2288,9 @@
}
}
}
-
-
-
+
+
+
// returns the actual topics that are set as possible tm-values
private ArrayList<Topic> getRawTmValues() throws InvalidGdlSchemaException{
if(this.rawTmValuesSet){
@@ -2281,32 +2302,32 @@
return this.rawTmValues;
}
}
-
-
+
+
// returns the actual data that is hold by this instance
public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier, boolean validate) throws InvalidGdlSchemaException, ExecutionException, InvalidContentException {
ArrayList<Pair<Construct, TopicMapsTypes>> result = new ArrayList<Pair<Construct,TopicMapsTypes>>();
if(this.getRootConstraint() == null) return result;
Construct localCarrier = carrier;
if(carrier == null) localCarrier = TmHelper.getNearestTopicOrAssociation(this);
-
+
//TODO: finalise
for (int idx = 0; idx != this.getSelectedValues().size(); ++idx){
if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclItemIdentifierConstraint)){
-
+
} else if (TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclSubjectIdentifierConstraint)){
-
+
} else if (TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclSubjectLocatorConstraint)){
-
+
} else if (TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicNameConstraint)){
if(!(localCarrier instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " must be bound to a Topic, but is: " + localCarrier.getClass());
Topic nameType = TmHelper.getConstrainedStatement(this.getConstraint());
JsArray<Name> names = ((Topic)localCarrier).getNames(nameType);
-
+
Name changedName = null;
if(this.getRootConstraint().equals(this.getConstraint())){
if(validate) this.validateLiteralValue(this.getSelectedValues().get(idx));
-
+
if(names.length() > idx){
changedName = names.get(idx);
changedName.setValue(this.getSelectedValues().get(idx));
@@ -2314,19 +2335,19 @@
changedName = ((Topic)localCarrier).createName(this.getSelectedValues().get(idx), nameType, null);
}
} // TODO: item-identifier, reifier, variant, ...
-
+
result.add(new Pair<Construct, TopicMapsTypes>(changedName, TopicMapsTypes.Name));
} else if (TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclVariantNameConstraint)){
-
+
} else if (TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicOccurrenceConstraint)){
if(!(localCarrier instanceof Topic)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " must be bound to a Topic, but is: " + localCarrier.getClass());
Topic occurrenceType = TmHelper.getConstrainedStatement(this.getConstraint());
JsArray<Occurrence> occurrences = ((Topic)localCarrier).getOccurrences(occurrenceType);
-
+
Occurrence changedOccurrence = null;
if(this.getRootConstraint().equals(this.getConstraint())){
if(validate) this.validateLiteralValue(this.getSelectedValues().get(idx));
-
+
if(occurrences.length() > idx){
changedOccurrence = occurrences.get(idx);
changedOccurrence.setValue(this.getSelectedValues().get(idx));
@@ -2334,19 +2355,19 @@
changedOccurrence = ((Topic)localCarrier).createOccurrence(occurrenceType, this.getSelectedValues().get(idx), null, null);
}
} // TODO: item-identifier, reifier, ...
-
+
result.add(new Pair<Construct, TopicMapsTypes>(changedOccurrence, TopicMapsTypes.Occurrence));
} else if (TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicRoleConstraint)){
if(!(localCarrier instanceof Association)) throw new ExecutionException("the constraint " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " must be bound to an Association, but is: " + localCarrier.getClass());
Pair<Topic, Topic> roleAndPlayerType = TmHelper.getConstrainedRoleAndPlayerTypeOfConstraint(this.getRootConstraint());
Topic roleType = roleAndPlayerType.getFirst();
Topic playerType = roleAndPlayerType.getSecond();
-
+
JsArray<Role> typedRoles = ((Association)localCarrier).getRoles(roleType);
ArrayList<Role> roles = new ArrayList<Role>();
for(int i = 0; i != typedRoles.length(); ++i)
if(TmHelper.isInstanceOf(typedRoles.get(i).getPlayer(), playerType)) roles.add(typedRoles.get(i));
-
+
Role changedRole = null;
if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.TMCL.tmclReifierConstraint)){
// TODO: implement
@@ -2371,7 +2392,7 @@
throw new InvalidGdlSchemaException("the constraint " + TmHelper.getAnyIdOfTopic(this.getRootConstraint()) + " is not supported");
}
}
-
+
return result;
}
}
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Mon Oct 17 08:41:37 2011 (r1003)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java Tue Oct 18 03:17:10 2011 (r1004)
@@ -857,6 +857,24 @@
}
+ // returns the topic that plays the role of tmcl:constrained in an association
+ // of the type tmcl:constrained-topic-type that is bound to the passed topic
+ // constraint-Topic that plays the role of tmcl:constraint
+ public static Topic getConstrainedTopicType(Topic constraintTopic) throws InvalidGdlSchemaException{
+ if(constraintTopic == null) return null;
+
+ TopicMap tm = constraintTopic.getTopicMap();
+ Topic constraintRoleType = getTopicByPsi(PSIs.TMCL.tmclConstraint, tm);
+ Topic constrainedTopicTypeAssocType = getTopicByPsi(PSIs.TMCL.tmclConstrainedTopicType, tm);
+ Topic constrainedRoleType = getTopicByPsi(PSIs.TMCL.tmclConstrained, tm);
+
+ ArrayList<Topic> constrainedTopicTypes = getOtherPlayerOfBinaryAssociation(constraintTopic, constraintRoleType, constrainedTopicTypeAssocType, null, constrainedRoleType);
+
+ if(constrainedTopicTypes.size() != 1) throw new InvalidGdlSchemaException("the topic " + getAnyIdOfTopic(constraintTopic) + " must be bound exactly once to a statement topic via a " + PSIs.TMCL.tmclConstrainedTopicType + " association, but is: " + constrainedTopicTypes.size());
+ else return constrainedTopicTypes.get(0);
+ }
+
+
// Returns the role-combination-constraints for the passed association-type
public static ArrayList<Topic> getRoleCombinationConstraints(Topic associationType){
if(associationType == null) return new ArrayList<Topic>();
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 Mon Oct 17 08:41:37 2011 (r1003)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Tue Oct 18 03:17:10 2011 (r1004)
@@ -7,10 +7,15 @@
"gdlt":"http://psi.isidor.us/gdl/types/",
"gdlsrv":"http://service.org/serviceregistry/gdl/",
"types":"http://services.org/serviceregistry/model/types/",
- "srv":"http://service.org/serviceregistry/"},
+ "srv":"http://service.org/serviceregistry/",
+ "iipref":"http://service.org/serviceregistry/iis/",
+ "slpref":"http://service.org/serviceregistry/sls/",
+ "srvpref":"http://service.org/serviceregistry/psis/service/"},
+
"item_type":"topicmap",
+
"topics": [{"subject_identifiers":["[tmcl:topic-type]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[tmcl:name-type]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[tmcl:occurrence-type]"], "instance_of":["si:[tmcl:topic-type]"]},
@@ -170,23 +175,42 @@
{"subject_identifiers":["[gdlsrv:service-psis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
{"subject_identifiers":["[gdlsrv:service-sls-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_sls_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
- {"subject_identifiers":["[gdlsrv:service-sls-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"30px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-sls-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"40px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-sls-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
{"subject_identifiers":["[gdlsrv:service-iis-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_iis_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
- {"subject_identifiers":["[gdlsrv:service-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"50px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"70px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
{"subject_identifiers":["[gdlsrv:service-name-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_name_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
- {"subject_identifiers":["[gdlsrv:service-name-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"70px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"110px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-name-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
{"subject_identifiers":["[gdlsrv:service-name-type-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_name_type_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
- {"subject_identifiers":["[gdlsrv:service-name-type-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"90px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-type-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"150px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
{"subject_identifiers":["[gdlsrv:service-name-type-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
- {"subject_identifiers":["[model:service-name-type-constraint]"], "instance_of":["si:[gdlt:Type]"]}
+ {"subject_identifiers":["[model:service-name-type-constraint]"], "instance_of":["si:[gdlt:Type]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-name-scope-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_name_scope_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-scope-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"190px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-scope-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-name-reifier-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_name_reifier_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-reifier-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"230px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-reifier-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-name-iis-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_name_iis_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"270px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+
+
+ {"subject_identifiers":["[model:sort-service-name-reifier]"], "instance_of":["si:[types:Reifier-Type]"]},
+ {"subject_identifiers":["[model:sort-service-variant-name-reifier]"], "instance_of":["si:[types:Reifier-Type]"]},
+ {"subject_identifiers":["[srvpref:sort-service]"], "subject_locators":["[slpref:sort-service]"], "item_identifiers":["[iipref:sort-service]"], "instance_of":["si:[types:Service]"], "names":[{"type":"si:[model:service-name]", "scope":["si:[model:english]"], "reifier":"si:[model:sort-service-name-reifier]", "item_identifiers":["[iipref:service-name-ii]"], "value":"Sort-Service", "variants":[{"datatype":"http://www.w3.org/2001/XMLSchema#string", "scope":["si:[model:symbolic-name]"], "reifier":"si:[model:sort-service-variant-name-reifier]", "item_identifiers":["[iipref:sort-service-variant-name-ii]"], "value":"symbolic name of sort-service"}]}]}
],
+
"associations": [{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[tmcl:constraint]"},{"type":"si:[tmdm:subtype]", "player":"si:[tmcl:topic-name-constraint]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[tmcl:constraint]"},{"type":"si:[tmdm:subtype]", "player":"si:[tmcl:subject-identifier-constraint]"}]},
{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[tmcl:constraint]"},{"type":"si:[tmdm:subtype]", "player":"si:[tmcl:subject-locator-constraint]"}]},
@@ -292,12 +316,12 @@
{"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-sls-text]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-sls-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-psis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-sls-text]"}]},
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-sls-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-sls-text]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-sls-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-sls-constraint]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-sls-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-sl-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-iis-text]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-iis-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-sls-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-iis-text]"}]},
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-iis-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-iis-text]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-iis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-iis-constraint]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-iis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-ii-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-text]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-iis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-text]"}]},
@@ -308,7 +332,23 @@
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-type-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-name-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-type-text]"}]},
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-type-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-type-text]"}]},
{"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-type-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-type-constraint]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-name-type-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-constraint]"}]}
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-name-type-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-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-scope-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-scope-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-name-type-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-scope-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-scope-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-scope-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-scope-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-scope-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-reifier-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-scope-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-reifier-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-reifier-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-reifier-text]"}]},
+ {"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: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]"}]}
+
+
]
}
\ No newline at end of file
Modified: trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Mon Oct 17 08:41:37 2011 (r1003)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Tue Oct 18 03:17:10 2011 (r1004)
@@ -1,18 +1,18 @@
-==> Service **
- ==> subject-identifier-constraint **
- ==> subject-locator-constraint **
- ==> item-identifier-constraint **
- ==> topic-name-constraint **
- ==> regular-expression-constraint **
- ==> Type *
- ==> scope-constraint *
- ==> reifier-constraint *
- ==> item-identifier-constraint *
- ==> variant-name-constraint *
- ==> Datatype
- ==> Variant-Name-Scope
- ==> Variant-Name-Identifiers
- ==> Variant-Name-Reifier
+==> Service ***
+ ==> subject-identifier-constraint ***
+ ==> subject-locator-constraint ***
+ ==> item-identifier-constraint ***
+ ==> topic-name-constraint ***
+ ==> regular-expression-constraint ***
+ ==> Type **
+ ==> scope-constraint ***
+ ==> reifier-constraint ***
+ ==> item-identifier-constraint ***
+ ==> variant-name-constraint * *
+ ==> Datatype *
+ ==> Variant-Name-Scope *
+ ==> Variant-Name-Identifiers *
+ ==> Variant-Name-Reifier *
==> Endpoint *
1
0

[isidorus-cvs] r1003 - in trunk/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/base war/gdl_widgets
by lgiessmann@common-lisp.net 17 Oct '11
by lgiessmann@common-lisp.net 17 Oct '11
17 Oct '11
Author: lgiessmann
Date: Mon Oct 17 08:41:37 2011
New Revision: 1003
Log:
gdl-frontend: Widgets: started to implement a actual GDL-Schema for the new test-schema
Modified:
trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm
trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Oct 17 08:14:12 2011 (r1002)
+++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Oct 17 08:41:37 2011 (r1003)
@@ -4,19 +4,14 @@
import us.isidor.gdl.anaToMia.TopicMaps.TmEngineModel.TmEngine;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
-import us.isidor.gdl.anaToMia.Widgets.isidorus.CommitCallback;
-import us.isidor.gdl.anaToMia.Widgets.isidorus.DeleteCallback;
-import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
import us.isidor.gdl.anaToMia.Widgets.environment.ICommitCallback;
import us.isidor.gdl.anaToMia.Widgets.environment.IDeleteCallback;
-import us.isidor.gdl.anaToMia.Widgets.environment.ILoadSchemaCallback;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.environment.TopicIdentifierTypes;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.http.client.RequestException;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
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 Mon Oct 17 08:14:12 2011 (r1002)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Mon Oct 17 08:41:37 2011 (r1003)
@@ -110,6 +110,7 @@
{"subject_identifiers":["[gdl:schema-name]"], "instance_of":["si:[tmcl:name-type]"]},
{"subject_identifiers":["[gdlt:Descriptor]"], "instance_of":["si:[tmcl:topic-type]"]},
{"subject_identifiers":["[gdlt:Visible-Object]"]},
+ {"subject_identifiers":["[gdlt:Type]"]},
{"subject_identifiers":["[gdl:id]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:padding-left]"], "instance_of":["si:[tmcl:occurrence-type]"]},
{"subject_identifiers":["[gdl:border-style]"], "instance_of":["si:[tmcl:occurrence-type]"]},
@@ -161,12 +162,29 @@
{"subject_identifiers":["[gdlt:Delete-Button]"]},
{"subject_identifiers":["[gdlsrv:service-schema]"], "instance_of":["si:[gdlt:Schema]"], "names":[{"type":"si:[gdl:schema-name]", "value":"GDL Schema for a Service UI"}]},
- {"subject_identifiers":["[gdlsrv:service-default-editor-topic-view]"], "instance_of":["si:[gdlt:Default-Editor-Topic-View]"], "names":[{"type":"si:[gdl:view-name]", "value":"GDL Default Editor Topic View for instances of http://services.org/serviceregistry/model/types/Service"}], "occurrences":[{"type":"si:[gdl:id]", "value":"service_default_editor_topic_view_id"}, {"type":"si:[gdl:width]", "value":"552px"}, {"type":"si:[gdl:height]", "value":"100px"},{"type":"si:[gdl:background-color]", "value":"gray"}]},
+ {"subject_identifiers":["[gdlsrv:service-default-editor-topic-view]"], "instance_of":["si:[gdlt:Default-Editor-Topic-View]"], "names":[{"type":"si:[gdl:view-name]", "value":"GDL Default Editor Topic View for instances of http://services.org/serviceregistry/model/types/Service"}], "occurrences":[{"type":"si:[gdl:id]", "value":"service_default_editor_topic_view_id"}, {"type":"si:[gdl:width]", "value":"552px"}, {"type":"si:[gdl:height]", "value":"300px"},{"type":"si:[gdl:background-color]", "value":"gray"}]},
{"subject_identifiers":["[gdlsrv:service-editor-view-binding]"], "instance_of":["si:[gdlt:TM-Single-Type-Value]"]},
{"subject_identifiers":["[gdlsrv:service-psis-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_psis_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
{"subject_identifiers":["[gdlsrv:service-psis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"10px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
- {"subject_identifiers":["[gdlsrv:service-psis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]}
+ {"subject_identifiers":["[gdlsrv:service-psis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-sls-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_sls_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-sls-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"30px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-sls-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-iis-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_iis_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-iis-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"50px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-name-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_name_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"70px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+
+ {"subject_identifiers":["[gdlsrv:service-name-type-text]"], "instance_of":["si:[gdlt:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_name_type_text_id"}, {"type":"si:[gdl:readonly]", "value":"false"}, {"type":"si:[gdl:width]", "value":"470px"},{"type":"si:[gdl:cursor]", "value":"text"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-type-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"90px"}, {"type":"si:[gdl:left]", "value":"10px"}]},
+ {"subject_identifiers":["[gdlsrv:service-name-type-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]},
+ {"subject_identifiers":["[model:service-name-type-constraint]"], "instance_of":["si:[gdlt:Type]"]}
],
"associations": [{"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[tmcl:constraint]"},{"type":"si:[tmdm:subtype]", "player":"si:[tmcl:topic-name-constraint]"}]},
@@ -269,7 +287,28 @@
{"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-psis-text]"}]},
{"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-psis-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-default-editor-topic-view]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-psis-text]"}]},
{"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-psis-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-psis-text]"}]},
- {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-psis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-psi-constraint]"}]}
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-psis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-psi-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-sls-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-sls-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-psis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-sls-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-sls-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-sls-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-sls-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-sls-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-iis-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-iis-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-sls-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-iis-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-iis-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-iis-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-iis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-iis-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-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-iis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-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-type-text]"}]},
+ {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-type-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-name-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-name-type-text]"}]},
+ {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-type-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-name-type-text]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-name-type-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-type-constraint]"}]},
+ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-name-type-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-name-constraint]"}]}
+
]
}
\ No newline at end of file
Modified: trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt
==============================================================================
--- trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Mon Oct 17 08:14:12 2011 (r1002)
+++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm.txt Mon Oct 17 08:41:37 2011 (r1003)
@@ -1,10 +1,10 @@
==> Service **
==> subject-identifier-constraint **
- ==> subject-locator-constraint *
- ==> item-identifier-constraint *
- ==> topic-name-constraint *
- ==> regular-expression-constraint *
- ==> Type
+ ==> subject-locator-constraint **
+ ==> item-identifier-constraint **
+ ==> topic-name-constraint **
+ ==> regular-expression-constraint **
+ ==> Type *
==> scope-constraint *
==> reifier-constraint *
==> item-identifier-constraint *
1
0