Changeset 1006 for trunk/src/anaToMia


Ignore:
Timestamp:
10/18/11 12:10:29 (14 years ago)
Author:
lgiessmann
Message:

gdl-frontend: Widgets: implemented the gdlt:Type semantics for retrieving data

Location:
trunk/src/anaToMia/GDL_Widgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java

    r1005 r1006  
    33
    44import java.util.ArrayList;
    5 
    6 import org.apache.commons.codec.language.RefinedSoundex;
    7 
    85import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
    96import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
     
    19801977                        }
    19811978                } else if(TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlType)){
    1982                         // TODO: implement: Type
     1979                        Topic type = null;
     1980                        if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicNameConstraint)){
     1981                                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());
     1982                                type = TmHelper.getConstrainedStatement(this.getRootConstraint());
     1983                        } else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicOccurrenceConstraint)){
     1984                                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());
     1985                                type = TmHelper.getConstrainedStatement(this.getRootConstraint());
     1986                        } else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclTopicRoleConstraint)){
     1987                                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());
     1988                                type = TmHelper.getConstrainedStatement(this.getRootConstraint());
     1989                        } else if(TmHelper.isInstanceOf(this.getRootConstraint(), PSIs.TMCL.tmclAssociationRoleConstraint)){
     1990                                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());
     1991                                type = TmHelper.getConstraintRoleOfConstraint(this.getRootConstraint());
     1992                        } else {
     1993                                String constraints = PSIs.TMCL.tmclTopicNameConstraint + ", " + PSIs.TMCL.tmclTopicOccurrenceConstraint + ", " + PSIs.TMCL.tmclTopicRoleConstraint + ", " + PSIs.TMCL.tmclAssociationRoleConstraint;
     1994                                throw new ExecutionException("The topic " + TmHelper.getAnyIdOfTopic(this.getConstraint()) + " must be bound to the following root constraints: " + constraints);
     1995                        }
     1996       
     1997                        String str = this.getTopicRepresentation(type, this.getDisplayByOfValueGroup(), this.getPreferredScopeOfValueGroup());
     1998                        if(str == null) str = "";
     1999                        this.addSubItem(str);
    19832000                } else if (TmHelper.isInstanceOf(this.getConstraint(), PSIs.GDL.TopicType.gdlDatatype)){
    19842001                        // TODO: implement: Datatype
  • TabularUnified trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TmHelper.java

    r1004 r1006  
    2323
    2424import com.google.gwt.core.client.JsArray;
     25import com.google.gwt.user.client.Window;
    2526
    2627
     
    181182                for(int i = 0; i != validRoles.length(); ++i){
    182183                        Association parent = validRoles.get(i).getParent();
     184                        Window.alert(">> " + parent.getRoles().length() + " >> " + parent.getRoles(supertype).length());
    183185                        if(parent.getRoles().length() == 2 && parent.getRoles(supertype).length() == 1)result.add(parent.getRoles(supertype).get(0).getPlayer());
    184186                }
  • TabularUnified trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm

    r1004 r1006  
    117117            {"subject_identifiers":["[gdlt:Visible-Object]"]},
    118118            {"subject_identifiers":["[gdlt:Type]"]},
     119            {"subject_identifiers":["[gdlt:Datatype]"]},
     120            {"subject_identifiers":["[gdlt:Variant-Name-Scope]"]},
     121            {"subject_identifiers":["[gdlt:Variant-Name-Identifiers]"]},
     122            {"subject_identifiers":["[gdlt:Variant-Name-Reifier]"]},
    119123            {"subject_identifiers":["[gdl:id]"], "instance_of":["si:[tmcl:occurrence-type]"]},
    120124            {"subject_identifiers":["[gdl:padding-left]"], "instance_of":["si:[tmcl:occurrence-type]"]},
     
    226230                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[types:Scope-Type]"},{"type":"si:[tmdm:subtype]", "player":"si:[types:Language]"}]},
    227231                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[types:Scope-Type]"},{"type":"si:[tmdm:subtype]", "player":"si:[types:Priority]"}]},
     232                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Visible-Object]"}]},
     233                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:View]"}]},
     234                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:View]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Topic-View]"}]},
     235                                  {"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]"}]},
     236                                  {"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]"}]},
     237                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Descriptor]"}]},
     238                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:TM-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value]"}]},
     239                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Literal-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value]"}]},
     240                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Default-Value]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value]"}]},
     241                                  {"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]"}]},
     242                                  {"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]"}]},
     243                                  {"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]"}]},
     244                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Text-Object]"}]},
     245                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Text]"}]},
     246                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Position]"}]},
     247                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Value-Group]"}]},
     248                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Button]"}]},
     249                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Button]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Action-Button]"}]},
     250                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Action-Button]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Delete-Button]"}]},
     251                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Type]"}]},
     252                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Datatype]"}]},
     253                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Variant-Name-Scope]"}]},
     254                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Variant-Name-Identifiers]"}]},
     255                                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdlt:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdlt:Variant-Name-Reifier]"}]},
    228256                                                                 
    229257                                 
Note: See TracChangeset for help on using the changeset viewer.