Skip to content

Commit

Permalink
Disable click to open and get the desired format from the rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarthez committed Oct 23, 2014
1 parent e00b234 commit 58855e0
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public class ERD2WGraphVizPage extends ERD2WPage {
*/
private static final long serialVersionUID = 1L;

/** interface for all the keys used in this pages code */
public interface Keys extends ERD2WPage.Keys {
public static String format = "format";
}

private int _nodeID = 0;

public ERD2WGraphVizPage(WOContext context) {
Expand Down Expand Up @@ -83,14 +88,24 @@ public NSArray<String> toManyRelationships() {
return result;
}

/*
* Disable click to open
*/
public boolean clickToOpenEnabled(WOResponse response, WOContext context) {
return false;
}

@Override
public void appendToResponse(WOResponse response, WOContext context) {
// we do NOT want to expose our model to just everyone...
if (ERXApplication.isDevelopmentModeSafe()) {
super.appendToResponse(response, context);
}
response.setHeader("text/plain", "content-type");
String format = context.request().stringFormValueForKey("format");
String format = (String) d2wContext().valueForKey(Keys.format);
if (format == null) {
format = context.request().stringFormValueForKey("format");
}
if (format != null) {
String dot = response.contentString();
File f = null;
Expand Down

0 comments on commit 58855e0

Please sign in to comment.