[isidorus-cvs] r843 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: isidorus view
lgiessmann at common-lisp.net
lgiessmann at common-lisp.net
Wed Sep 7 10:48:20 UTC 2011
Author: lgiessmann
Date: Wed Sep 7 03:48:19 2011
New Revision: 843
Log:
gdl-frontend: Widgets: each instance of GdlDefaultCreatorTopicView and GdlSpecialCreatorTopicView sets the topic type of a topic instance automatically by examining the requested topic types of the GdlPanel class
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java Wed Sep 7 03:23:59 2011 (r842)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java Wed Sep 7 03:48:19 2011 (r843)
@@ -82,17 +82,12 @@
Locator psi = tm.createLocator("http://textgrid.org/serviceregistry/environment/" + envName.getValue());
top.removeSubjectIdentifier(carrierLocator);
top.addSubjectIdentifier(psi);
- top.addType(TmHelper.getTopicByPsi("http://textgrid.org/serviceregistry/model/types/Environment", tm));
}
String jtm = null;
if(topicMaps.size() != 0){
jtm = tmEngine.exportTm(topicMaps.get(0));
} else if(topics.size() != 0){
- topics.add(TmHelper.getTopicByPsi("http://textgrid.org/serviceregistry/model/types/Environment", tm));
- topics.add(TmHelper.getTopicByPsi("http://textgrid.org/serviceregistry/model/environment-name", tm));
- topics.add(TmHelper.getTopicByPsi(PSIs.TMCL.tmclNameType, tm));
- topics.add(TmHelper.getTopicByPsi(PSIs.TMCL.tmclTopictype, tm));
jtm = tmEngine.exportTm(topics, new ArrayList<Association>());
}
@@ -171,6 +166,8 @@
commitBuilder.setHeader("Content-type", "application/json");
RequestBuilder getBuilder = new RequestBuilder(RequestBuilder.GET, getUrl);
try{
+ //RootPanel.getBodyElement().setInnerText(jtm); //TODO: remove
+
if(edited)getBuilder.sendRequest(null, new EditedHashObjectCommitRequest(null, jtm, false));
else commitBuilder.sendRequest(jtm, new HashObjectCommitRequest(jtm));
}catch(RequestException e){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java Wed Sep 7 03:23:59 2011 (r842)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java Wed Sep 7 03:48:19 2011 (r843)
@@ -21,6 +21,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidContentException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+import us.isidor.gdl.anaToMia.Widgets.environment.TopicIdentifierTypes;
import us.isidor.gdl.anaToMia.Widgets.value.ContentOrientationValue;
@@ -177,11 +178,21 @@
}
- // returns the recieved topic or creates a topic stub
+ // returns the received topic or creates a topic stub
public Topic getRepresentedTopic() throws InvalidGdlSchemaException {
if(this.receivedData ==null){
if(this.representedTopic == null){
this.representedTopic = this.tmRepresentative.getTopicMap().createTopicBySubjectIdentifier(this.tm.createLocator(PSIs.GDL.gdl + this.getId()));
+
+ if((this instanceof GdlDefaultCreatorTopicView) || (this instanceof GdlSpecialCreatorTopicView)){
+ ArrayList<Topic> topicTypes = new ArrayList<Topic>();
+ ArrayList<Pair<String, TopicIdentifierTypes>> ids = this.getRoot().getReqeustedTopicsToCreate();
+ if(ids != null)
+ for (Pair<String, TopicIdentifierTypes> pair : ids) topicTypes.add(TmHelper.getTopicByAnyIdentifier(pair, this.tmRepresentative.getTopicMap()));
+
+ for (Topic topType : topicTypes) this.representedTopic.addType(topType);
+ }
+
return this.representedTopic;
} else {
return this.representedTopic;
More information about the Isidorus-cvs
mailing list