Skip to content

Commit

Permalink
Fix #314, #317, #316, #309, #311, #305
Browse files Browse the repository at this point in the history
Several issue fixes (See issues for more details)
  • Loading branch information
dgarijo committed Nov 12, 2018
1 parent 79e8b03 commit ef8c2b7
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 114 deletions.
47 changes: 1 addition & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>es.oeg</groupId>
<artifactId>widoco</artifactId>
<packaging>jar</packaging>
<version>1.4.6</version>
<version>1.4.7</version>
<name>Widoco</name>


Expand All @@ -30,13 +30,6 @@
<artifactId>OWL2VOWL</artifactId>
<version>0.3.4</version>
</dependency>


<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet</artifactId>
<version>2.2.0</version>
</dependency>


<dependency>
Expand Down Expand Up @@ -171,17 +164,9 @@
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<!--<artifactId>owlapi-osgidistribution</artifactId>
5.1.0 was the previous one. Test to align to webVowl-->
<version>5.1.7</version>
</dependency>

<!--<dependency>
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-rio-ntriples</artifactId>
<version>2.7.12</version>
</dependency>-->

<dependency>
<groupId>com.googlecode.json-simple </groupId>
<artifactId>json-simple</artifactId>
Expand All @@ -205,11 +190,6 @@
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>unknown.binary</groupId>
<artifactId>AbsoluteLayout</artifactId>
<version>SNAPSHOT</version>
</dependency>
</dependencies>

<dependencyManagement>
Expand All @@ -218,31 +198,6 @@
<build>

<plugins>
<!-- <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<outputDirectory>jar/</outputDirectory>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>widoco.gui.GuiController</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>simple</goal>
</goals>
</execution>
</executions>
</plugin>-->
<!-- Previous plugin was replaced becaude it didin't pack sesame jars correctly-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
28 changes: 16 additions & 12 deletions src/main/java/widoco/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ public class Constants {


public static String getAbstractSection(String abstractContent, Configuration c, Properties langFile){
String abstractSection = "<h2>"+langFile.getProperty(LANG_ABSTRACT)+"</h2><span class=\"markdown\">\n";
String abstractSection = "<html>\n<h2>"+langFile.getProperty(LANG_ABSTRACT)+"</h2><span class=\"markdown\">\n";
if(abstractContent!=null && !"".equals(abstractContent)){
abstractSection+=abstractContent;
}
else{
abstractSection+=langFile.getProperty(LANG_ABSTRACT_PLACEHOLDER);
}
abstractSection+="</span>\n";
abstractSection+="</span>\n</html>\n";
return abstractSection;
}

Expand All @@ -287,19 +287,21 @@ public static String getIntroductionSectionTitleAndPlaceHolder(Configuration c,
}

public static String getReferencesSection(Configuration c, Properties lang){
String s ="<h2 id=\"ref\" class=\"list\">"+lang.getProperty(LANG_REFERENCES_PLACEHOLDER);
String s ="<html>\n<h2 id=\"ref\" class=\"list\">"+lang.getProperty(LANG_REFERENCES_PLACEHOLDER)+"\n</html>\n";
return s;
}

public static String getAcknowledgementsSection(Configuration c, Properties lang){
String s = "<div id=\"acknowledgements\">\n"+
"<h2 id=\"ack\" class=\"list\">"+lang.getProperty(LANG_AC_TEXT);
String s = "<html>\n<div id=\"acknowledgements\">\n"+
"<h2 id=\"ack\" class=\"list\">"+lang.getProperty(LANG_AC_TEXT)+"\n</html>\n";
return s;
}

public static String getChangeLogSection(Configuration c, CompareOntologies comp, Properties lang){
String s = "<div id=\"changelog\">\n"+
String s = "<html>\n<div id=\"changelog\">\n"+
"<h2 id=\"changes\" class=\"list\">"+lang.getProperty(LANG_CHANGELOG_HEAD)+"</h2>\n";
s+=OntologyDifferencesRenderer.differencesToHTML(comp, c.getMainOntology().getNamespaceURI(), lang);
s+="</div>";
s+="</div>\n<html>\n";
//return lang.getProperty("changeLog");
return s;
}
Expand Down Expand Up @@ -568,21 +570,23 @@ public static String getIndexDocument(String resourcesFolderName,Configuration c
" t+='</ul>';\n" +
" j=0;\n" +
" }\n" +
" t+= '<li>'+i+'. <a href=#'+ jQuery(this).attr('id')+'>'+ jQuery(this).text()+'</a></li>';\n" +
" t+= '<li>'+i+'. <a href=#'+ jQuery(this).attr('id')+'>'+ jQuery(this).ignore(\"span\").text()+'</a></li>';\n" +
" i++;\n" +
" }\n" +
" if(jQuery(this).is('h3')){\n" +
" if(j==0){\n" +
" t+='<ul>';\n" +
" }\n" +
" j++;\n" +
" t+= '<li>'+(i-1)+'.'+j+'. '+'<a href=#'+ jQuery(this).attr('id')+'>'+ jQuery(this).text()+'</a></li>';\n" +
" t+= '<li>'+(i-1)+'.'+j+'. '+'<a href=#'+ jQuery(this).attr('id')+'>'+ jQuery(this).ignore(\"span\").text()+'</a></li>';\n" +
" }\n" +
" t = t.replace(' "+lang.getProperty(LANG_BACK3).replace("&iacute;", "í")+"','');\n" +//back to ToC
" });\n" +
" t+='</ul>';\n" +
" $(\"#toc\").html(t); \n" +
"}\n"+
" $.fn.ignore = function(sel){\n" +
" return this.clone().find(sel||\">*\").remove().end();\n" +
" };"+
" $(function(){\n";
//the script for loading the table is called after loading everything else, after the loadHash function
if(c.isIncludeAbstract()) document += " $(\"#abstract\").load(\"sections/abstract-"+c.getCurrentLanguage()+".html\"); \n";
Expand Down Expand Up @@ -726,11 +730,11 @@ public static String getOverviewSectionTitleAndPlaceHolder(Configuration c, Prop
}

public static String getDescriptionSectionTitleAndPlaceHolder(Configuration c, Properties lang){
return "<h2 id=\"desc\" class=\"list\">"+c.getMainOntology().getName()+": "+lang.getProperty(LANG_DESCRIPTION_PLACEHOLDER);
return "<html>\n<h2 id=\"desc\" class=\"list\">"+c.getMainOntology().getName()+": "+lang.getProperty(LANG_DESCRIPTION_PLACEHOLDER)+"\n</html>\n";
}

public static String getCrossReferenceSectionTitleAndPlaceHolder(Configuration c, Properties lang){
return "<h2 id=\"crossreference\" class=\"list\">"+lang.getProperty(LANG_CROSS_REF_TITLE)+" "+c.getMainOntology().getName()+" "+lang.getProperty(LANG_CROSS_REF_TITLE2)+"</h2>"+"\n" +
return "<h2 id=\"crossreference\" class=\"list\">"+lang.getProperty(LANG_CROSS_REF_TITLE)+" "+c.getMainOntology().getName()+" "+lang.getProperty(LANG_CROSS_REF_TITLE2)+"</h2>"+"\n" +
lang.getProperty(LANG_CROSS_REF_PLACEHOLDER)+c.getMainOntology().getName()+".\n";
}

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/widoco/CreateResources.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,11 @@ private static void createIntroductionSection(String path, HashMap<String,String
if((c.getIntroductionPath()!=null) && (!"".equals(c.getIntroductionPath()))){
WidocoUtils.copyExternalResource(c.getIntroductionPath(),new File(path+File.separator+"introduction-"+c.getCurrentLanguage()+".html"));
}else{
String introSectionText = Constants.getIntroductionSectionTitleAndPlaceHolder(c, lang);
String introSectionText = "<html>"+Constants.getIntroductionSectionTitleAndPlaceHolder(c, lang);
if(nsDecl!=null && !nsDecl.isEmpty()){
introSectionText += Constants.getNameSpaceDeclaration(nsDecl,c, lang);
}
introSectionText+="</html>";
saveDocument(path+File.separator+"introduction-"+c.getCurrentLanguage()+".html", introSectionText,c);
}
}
Expand All @@ -211,7 +212,7 @@ private static void createOverviewSection(String path, Configuration c, String c
if((c.getOverviewPath()!=null) && (!"".equals(c.getOverviewPath()))){
WidocoUtils.copyExternalResource(c.getOverviewPath(), new File(path+File.separator+"overview-"+c.getCurrentLanguage()+".html"));
}else{
String overViewSection = Constants.getOverviewSectionTitleAndPlaceHolder(c, lang);
String overViewSection = "<html>"+Constants.getOverviewSectionTitleAndPlaceHolder(c, lang);
if(!"".equals(classesList) && classesList!=null){
overViewSection+=("<h4>"+lang.getProperty(Constants.LANG_CLASSES)+"</h4>\n");
overViewSection+=(classesList);
Expand All @@ -236,6 +237,7 @@ private static void createOverviewSection(String path, Configuration c, String c
if(c.isCreateWebVowlVisualization()){
overViewSection +="<iframe align=\"center\" width=\"100%\" height =\"500px\" src=\"webvowl/index.html#\"></iframe> ";
}
overViewSection+="</html>\n";
saveDocument(path+File.separator+"overview-"+c.getCurrentLanguage()+".html", overViewSection,c);
}
}
Expand All @@ -250,7 +252,7 @@ private static void createDescriptionSection(String path, Configuration c, Prope

private static void createCrossReferenceSection(String path,LODEParser lodeParser, Configuration c, Properties lang){
//cross reference section has to be included always.
String crossRef = Constants.getCrossReferenceSectionTitleAndPlaceHolder(c, lang);
String crossRef = "<html>"+Constants.getCrossReferenceSectionTitleAndPlaceHolder(c, lang);
String classesList = lodeParser.getClassList(),propList = lodeParser.getPropertyList(), dataPropList = lodeParser.getDataPropList(),
annotationPropList = lodeParser.getAnnotationPropList(), namedIndividualList = lodeParser.getNamedIndividualList();
if(classesList!=null && !"".equals(classesList)){
Expand All @@ -269,7 +271,7 @@ private static void createCrossReferenceSection(String path,LODEParser lodeParse
crossRef += lodeParser.getNamedIndividuals();
}
//add legend
crossRef+=Constants.getLegend(lang);
crossRef+=Constants.getLegend(lang)+"\n</html>\n";
saveDocument(path+File.separator+"crossref-"+c.getCurrentLanguage()+".html", crossRef,c);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/gui/EditProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public EditProperty(GuiStep2 g, Configuration c, PropertyType p) {
this.setTitle("Editing Imported Ontologies");
this.addRowButton.setText("Add ontology...");
this.deleteRowButton.setText("Delete ontology...");
createTable(new String[]{"Extended Ontology Name","Extended Ontology URI"});
createTable(new String[]{"Imported Ontology Name","Imported Ontology URI"});
loadOntologies(c.getMainOntology().getImportedOntologies());
break;
case license:
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/widoco/gui/GuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,20 @@ public enum State{initial, metadata, loadingConfig, sections, loading, generated
public GuiController() {
this.state = State.initial;
config = new Configuration();
System.out.println("\n\n--WIzard for DOCumenting Ontologies (WIDOCO).\n https://w3id.org/widoco/\n");
System.out.println("\nYou are launching WIDOCO GUI\n");
System.out.println("\nTo use WIDOCO through the command line please do:\n");
System.out.println("java -jar widoco.jar [-ontFile file] or [-ontURI uri] [-outFolder folderName] [-confFile propertiesFile] [-getOntologyMetadata] [-oops] "
+ "[-rewriteAll] [-crossRef] [-saveConfig configOutFile] [-lang lang1-lang2] [-includeImportedOntologies] [-htaccess] [-licensius] [-webVowl] "
+ "[-ignoreIndividuals] [-includeAnnotationProperties] [-analytics analyticsCode] [-doNotDisplaySerializations] [-displayDirectImportsOnly]"
+ "[-rewriteBase rewriteBasePath]. \nSee more information in https://github.com/dgarijo/Widoco/#how-to-use-widoco\n");
//read logo
gui = new GuiStep1(this);
gui.setVisible(true);
try {
gui = new GuiStep1(this);
gui.setVisible(true);
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
System.out.println("Error while launching the GUI"+e.getMessage());
}
}

Expand Down
11 changes: 9 additions & 2 deletions src/main/java/widoco/gui/GuiStep2.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void stopLoadingAnimation(){
}

private void refreshTable(){
String authors="", contributors="", imported="", extended="";
String authors="", contributors="", imported="", extended="", publisher="";
for(Agent a: conf.getMainOntology().getCreators()){
if(a.getName()==null || a.getName().equals("")){
authors+="creator; ";
Expand Down Expand Up @@ -192,6 +192,13 @@ private void refreshTable(){
extended+=a.getName()+"; ";
}
}
Agent p = conf.getMainOntology().getPublisher();
if(p.getName()==null || p.getName().equals("")){
publisher+="publisherName ";
}
else{
publisher+=p.getName();
}
tableProperties.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{"abstract", conf.getAbstractSection()},
Expand All @@ -206,7 +213,7 @@ private void refreshTable(){
{"ontology revision", conf.getMainOntology().getRevision()},
{"authors", authors},
{"contributors", contributors},
{"publisher", conf.getMainOntology().getPublisher().getURL()},
{"publisher", publisher},
{"imported ontologies", imported},
{"extended ontologies", extended},
{"license", conf.getMainOntology().getLicense().getUrl()},
Expand Down
31 changes: 19 additions & 12 deletions src/main/java/widoco/gui/TestInterface.form
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,25 @@
</Property>
</Properties>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="false"/>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="sidePanel" min="-2" pref="200" max="-2" attributes="0"/>
<EmptySpace min="340" pref="340" max="-2" attributes="0"/>
<Component id="labelChangeAtTheEnd" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sidePanel" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="450" pref="450" max="-2" attributes="0"/>
<Component id="labelChangeAtTheEnd" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="sidePanel">
Expand All @@ -55,11 +72,6 @@
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="0" y="0" width="200" height="500"/>
</Constraint>
</Constraints>

<Layout>
<DimensionLayout dim="0">
Expand Down Expand Up @@ -320,11 +332,6 @@
<Properties>
<Property name="text" type="java.lang.String" value="Change to white at the end"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="540" y="450" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
Expand Down
21 changes: 17 additions & 4 deletions src/main/java/widoco/gui/TestInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ private void initComponents() {

backgroundPanel.setBackground(new java.awt.Color(204, 204, 204));
backgroundPanel.setPreferredSize(new java.awt.Dimension(1000, 500));
backgroundPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

sidePanel.setBackground(new java.awt.Color(255, 255, 255));

Expand Down Expand Up @@ -263,10 +262,24 @@ public void mouseEntered(java.awt.event.MouseEvent evt) {
.addGap(102, 102, 102))
);

backgroundPanel.add(sidePanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 200, 500));

labelChangeAtTheEnd.setText("Change to white at the end");
backgroundPanel.add(labelChangeAtTheEnd, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 450, -1, -1));

javax.swing.GroupLayout backgroundPanelLayout = new javax.swing.GroupLayout(backgroundPanel);
backgroundPanel.setLayout(backgroundPanelLayout);
backgroundPanelLayout.setHorizontalGroup(
backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(backgroundPanelLayout.createSequentialGroup()
.addComponent(sidePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(340, 340, 340)
.addComponent(labelChangeAtTheEnd))
);
backgroundPanelLayout.setVerticalGroup(
backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sidePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(backgroundPanelLayout.createSequentialGroup()
.addGap(450, 450, 450)
.addComponent(labelChangeAtTheEnd))
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
Expand Down
Loading

0 comments on commit ef8c2b7

Please sign in to comment.