Mentions légales du service

Skip to content
Snippets Groups Projects
Commit b7e92dc0 authored by Chan Leduc's avatar Chan Leduc
Browse files

--Improved portability of plugin

parent 266e6f44
No related branches found
No related tags found
No related merge requests found
......@@ -402,21 +402,21 @@ public class AlignView extends ViewPart
//fill "alignmentTable"
public String fetchAlignFromServer(String id) {
URIAlignment align = null;
Alignment align = null;
String alignKey = null;
if( idMap.containsKey(id) ) {
alignKey = idMap.get(id);
align = (URIAlignment)AlignView.alignmentTable.get( alignKey );
align = AlignView.alignmentTable.get( alignKey );
} else {
onlineAlign.getRDFAlignmentMonoThread( id );
FileWriter out = null;
String rdfalignStr = onlineAlign.getRDFAlignmentParsed( );// selectedAlign , alignImportButton, alignStoreButton,
//serverAlignTrimButton, allAlignButton, alignFindButton, mapButton );
String rdfalignStr = onlineAlign.getRDFAlignment( id );
alignKey = alignFolder.getAbsolutePath() + File.separator + getNewAlignId();
//System.out.println("alignKey="+alignKey);
String rdfPath = alignKey + ".rdf";
try {
......@@ -431,12 +431,18 @@ public class AlignView extends ViewPart
AlignmentParser ap = new AlignmentParser(0);
ap.setEmbedded( true );
align = (URIAlignment)ap.parse(file.toURI().toString());
//System.out.println(" parsing string ... ");
//align = ap.parseString( rdfalignStr );
align = ap.parse( file.toURI().toString() );
//if(align==null) System.out.println("align null" ); else System.out.println("align non null" );
AlignView.alignmentTable.put( alignKey , (Alignment)align );
idMap.put(id, alignKey);
localAlignBox.setEnabled(true);
localAlignBox.add(alignKey, 0);
selectedLocalAlign = alignKey;
selectedLocalAlign = alignKey;
localAlignBox.select(0);
localAlignBox.redraw();
......
......@@ -29,7 +29,7 @@ import java.net.URI;
import java.util.Vector;
import java.util.Enumeration;
import org.semanticweb.kaon2.api.formatting.OntologyFileFormat;
//import org.semanticweb.kaon2.api.formatting.OntologyFileFormat;
import org.semanticweb.owl.align.Alignment;
import fr.inrialpes.exmo.align.impl.BasicAlignment;
import fr.inrialpes.exmo.align.impl.ObjectAlignment;
......@@ -68,14 +68,9 @@ public class OfflineAlign {
ImportExportControl ieControl = new ImportExportControl();
//Integer name1 = new Integer(AlignView.alignId++);
//Integer name2 = new Integer(AlignView.alignId++);
File f1 = new File( selectedNeOnOnto1.replace("file:","") );
File f2 = new File( selectedNeOnOnto2.replace("file:","") );
//File f1 = new File( selectedNeOnOnto1.replace("file:","") );
//File f2 = new File( selectedNeOnOnto2.replace("file:","") );
//String fname1 = f1.getName();
//String fname2 = f2.getName();
//System.out.println("Filename 1="+ selectedNeOnOnto1);
//System.out.println("Filename 2="+ selectedNeOnOnto2);
Parameters p = new BasicParameters();
AlignmentProcess A1 = null;
......@@ -100,6 +95,7 @@ public class OfflineAlign {
A1.align((Alignment)null,p);
//AlignView.alignObjects.clear();
//System.out.println(" alignKey From Offline"+ alignFolder.getAbsolutePath() + File.separator + name.toString());
AlignView.alignmentTable.put( alignFolder.getAbsolutePath() + File.separator + name.toString(), (Alignment)A1 );
......@@ -207,7 +203,7 @@ public class OfflineAlign {
String key = v.get(i).replace(".rdf", "");
//System.out.println("Path ="+ alignFolder.getAbsolutePath() + File.separator + v.get(i) );
AlignView.alignmentTable.put( alignFolder.getAbsolutePath() + File.separator + key ,
parser.parse(alignFolder.getAbsolutePath() + File.separator + v.get(i)) );
parser.parse( alignFolder.getAbsolutePath() + File.separator + v.get(i)) );
}
} catch ( Exception ex ) { ex.printStackTrace();};
......
......@@ -525,7 +525,7 @@ public class OnlineAlign {
return result[0];
}
public void getRDFAlignment(String alignId ) {
public String getRDFAlignment(String alignId ) {
//retrieve alignment for storing in OWL file
......@@ -538,7 +538,7 @@ public class OnlineAlign {
params.setParameter( "arg1", alignId);
params.setParameter( "arg2", "fr.inrialpes.exmo.align.impl.renderer.RDFRendererVisitor");
//String answer = null;
String answer = null;
try {
// Read parameters
......@@ -546,18 +546,26 @@ public class OnlineAlign {
// Create the SOAP message
String message = createMessage( params );
//globalMess = createMessage( globalParam );
//System.out.println("URL SOAP :"+ SOAPUrl + ", Action:"+ SOAPAction);
//System.out.println("Message :" + message);
// Send message
//answer = sendMessage( message, params );
//the result is put in "globalAnswer"
sendMessageMonoThread( message, params );
answer = sendMessageMonoThread( message, params );
//if(! connected ) return null;
} catch ( Exception ex ) { ex.printStackTrace(); };
Document domMessage = null;
try {
domMessage = BUILDER.parse( new ByteArrayInputStream( answer.getBytes()) );
} catch ( IOException ioex ) {
ioex.printStackTrace();
} catch ( SAXException saxex ) {
saxex.printStackTrace();
}
String result[] = getTagFromSOAP( domMessage, "retrieveResponse/result/RDF" );
return result[0];
}
public void getRDFAlignmentMonoThread(String alignId) {
......@@ -907,8 +915,8 @@ public class OnlineAlign {
StringBuffer lineBuff = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
lineBuff.append(line + "\n");
while ( (line = in.readLine()) != null) {
lineBuff.append( line + "\n");
}
if (in != null)
in.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment