Skip to content

Commit

Permalink
Typo fix; fix dgarijo#125
Browse files Browse the repository at this point in the history
Now a concrete error is returned when the documentation process fails
(interface). In particular, when an import is wrong.
  • Loading branch information
dgarijo committed Jan 12, 2016
1 parent e25c3ad commit f60bebb
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 39 deletions.
Binary file modified JAR/widoco-0.0.1-jar-with-dependencies.jar
Binary file not shown.
64 changes: 32 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@

<dependencies>

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


<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${ver.log4j}</version>
<exclusions>
<!-- Exclude things that don't resolve in some versions of log4j -->
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${ver.log4j}</version>
<exclusions>
<!-- Exclude things that don't resolve in some versions of log4j -->
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
</exclusions>
</dependency>


<dependency>
Expand Down Expand Up @@ -157,9 +157,9 @@
</dependency>

<dependency>
<groupId>com.googlecode.json-simple </groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
<groupId>com.googlecode.json-simple </groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
</dependencies>

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/lode/LODEGeneration.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
public class LODEGeneration {

public static String getLODEhtml(Configuration c, File lodeResources) {
public static String getLODEhtml(Configuration c, File lodeResources) throws Exception {
try {

String content = "";
Expand All @@ -66,8 +66,9 @@ public static String getLODEhtml(Configuration c, File lodeResources) {
}
catch (Exception e) {
System.err.println("Error while applying LODE. Error while applying the XLS file: "+e.getMessage());
throw e;
}
return null;
//return null;
}

private static String parseWithOWLAPI(
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/widoco/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ public class Configuration {

private boolean useW3CStyle;

private String error;//Latest error to show to user via interface.

//model everything as a singleton object. No need: only the controller accesses this file.
public Configuration() {
propertyFile = new Properties();
Expand Down Expand Up @@ -156,6 +158,7 @@ private void cleanConfig(){
languages.put("en", false);
}
useW3CStyle = true;//by default
error = "";
}

private void loadConfigPropertyFile(String path){
Expand Down Expand Up @@ -804,4 +807,14 @@ public boolean isUseW3CStyle() {
public void setUseW3CStyle(boolean useW3CStyle) {
this.useW3CStyle = useW3CStyle;
}

public void setError(String error) {
this.error = error;
}

public String getError() {
return error;
}


}
4 changes: 2 additions & 2 deletions src/main/java/widoco/CreateDocInThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public void run() {
}
this.pointerToMain.switchState("next");
}catch(Exception e){
System.err.println("Error" +e.getMessage());
// e.printStackTrace();
System.err.println("Error " +e.getCause().getLocalizedMessage());
c.setError("Error: " +e.getCause().getLocalizedMessage());
this.pointerToMain.switchState("error");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/CreateResources.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class CreateResources {

//to do: analyze if this is the right name for the class. Maybe "generate" is better
public static void generateDocumentation(String folderOut, Configuration c, boolean fromURI, File lodeResources){
public static void generateDocumentation(String folderOut, Configuration c, boolean fromURI, File lodeResources) throws Exception{
String lodeContent;
lodeContent = LODEGeneration.getLODEhtml(c, lodeResources);
LODEParser lode = new LODEParser(lodeContent,c);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/widoco/TextConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,9 @@ public static String getProvenanceRDF(Configuration c){
provrdf+="\t prov:wasRevisionOf <"+c.getPreviousVersion()+">;\n";
}
if(c.getReleaseDate()!=null &&!"".equals(c.getReleaseDate())){
provrdf+="\t prov:wasGeneratedAt \""+c.getReleaseDate()+"\".\n";
provrdf+="\t prov:wasGeneratedAt \""+c.getReleaseDate()+"\";\n";
}
provrdf +=".\n";
return provrdf;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/gui/GuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void switchState(String input){
break;
case loading:
if(input.equals("error")){
JOptionPane.showMessageDialog(gui,"error while generating the documentation! refine this error.");
JOptionPane.showMessageDialog(gui,config.getError());
}else{
config.vocabularySuccessfullyGenerated();
if(config.getCurrentLanguage()!=null){
Expand Down

0 comments on commit f60bebb

Please sign in to comment.