Skip to content

Commit

Permalink
Bugfixing, remove references to TreeTable
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Stalla committed Sep 9, 2015
1 parent 0d58fe8 commit 26e1cb7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 162 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ application with a responsive web user interface, REST APIs, users and permissio
which is easy to incrementally extend and customize, both graphically and in functionality (e.g., adding new buttons to
existing pages).

Portofino is based on popular and proved open source libraries such as Hibernate, Groovy, Apache Shiro, the Stripes web
Portofino is based on popular and proven open source libraries such as Hibernate, Groovy, Apache Shiro, the Stripes web
framework, Twitter Bootstrap, Jersey JAX-RS.

The home of Portofino is http://portofino.manydesigns.com. There you can find the documentation, pointers to community
Expand Down
16 changes: 1 addition & 15 deletions demo-tt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<!--
<dependency>
<groupId>com.manydesigns</groupId>
<artifactId>portofino-h2</artifactId>
<artifactId>portofino-oracle</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.manydesigns</groupId>
<artifactId>portofino-googlecloudsql</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
-->
<!-- No support for OpedID for now
<dependency>
<groupId>com.manydesigns</groupId>
Expand All @@ -52,12 +44,6 @@
<scope>compile</scope>
</dependency>
-->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.170</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.manydesigns</groupId>
<artifactId>portofino-admin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -167,19 +168,23 @@ public Resolution getTables() {

String lastDatabase = null;
String lastSchema = null;
Map schema =null;
Map database = null ;
Map schema = null;
Map database = null;
List<Table> tables = getAllTables();
for(Table table : tables) {
if(table.getPrimaryKey() == null) {
continue;
}
if(table.getDatabaseName().equals(lastDatabase)) {
if(!table.getSchemaName().equals(lastSchema)) {
lastSchema = table.getSchemaName();
schema = createObject(table.getSchemaName(),false,true,false,null,null);
}
} else {
if(!table.getDatabaseName().equals(lastDatabase)) {
lastDatabase = table.getDatabaseName();
database = createObject(table.getDatabaseName(),false,true,false, null, new ArrayList());
treeTables.add(database);
lastSchema = null;
}
if(!table.getSchemaName().equals(lastSchema)) {
lastSchema = table.getSchemaName();
schema = createObject(table.getSchemaName(), false, true, false, null, new ArrayList());

String changelogFileNameTemplate = "{0}-changelog.xml";
String changelogFileName = MessageFormat.format(
changelogFileNameTemplate, table.getDatabaseName() + "-" + table.getSchemaName());
Expand All @@ -190,14 +195,8 @@ public Resolution getTables() {
}

lastSchema = table.getSchemaName();
ArrayList<Map> schemas = new ArrayList<Map>();
ArrayList<Map> cTables = new ArrayList<Map>();
schema = createObject(schemaDescr,false,true,false,null,cTables);
schemas.add(schema);

lastDatabase = table.getDatabaseName();
database = createObject(table.getDatabaseName(),false,true,false,null,schemas);
treeTables.add(database);
schema = createObject(schemaDescr,false,true,false,null, new ArrayList());
((List)database.get("children")).add(schema);
}
String tableDescr = table.getTableName();
if(!table.getActualEntityName().equals(table.getTableName())) {
Expand All @@ -207,10 +206,12 @@ public Resolution getTables() {
((List)schema.get("children")).add( createObject(tableDescr,false,false,false,href,null) );
}

return new StreamingResolution("text/json",new JsonBuilder(treeTables).toPrettyString());
return new StreamingResolution("text/json", new JsonBuilder(treeTables).toPrettyString());
}

private Map createObject(String title, boolean expanded, boolean folder, boolean lazy , String href , List children ){
private Map createObject(
String title, boolean expanded, boolean folder, boolean lazy,
@Nullable String href, @Nullable List children) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("title",title);
map.put("expanded",expanded);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,7 @@
<script src="<stripes:url value="/webjars/fancytree/2.11.0/dist/src/jquery.fancytree.table.js"/>" type="text/javascript"></script>
<script src="<stripes:url value="/webjars/fancytree/2.11.0/dist/src/jquery.fancytree.wide.js"/>" type="text/javascript"></script>

<!-- (Irrelevant source removed.) -->

<style type="text/css">
/* Define custom width and alignment of table columns */
#treetable {
table-layout: fixed;
}
#treetable tr td:nth-of-type(1) {
text-align: right;
}
#treetable tr td:nth-of-type(2) {
text-align: center;
}
#treetable tr td:nth-of-type(3) {
min-width: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
ul.fancytree-ext-wide {
border: none;
}
Expand Down Expand Up @@ -88,7 +70,7 @@
activate: function(event, data) {
var node = data.node;
if( node.data.href!=null ){
window.location.href="<%= actionBean.getActionPath()%>/"+node.data.href;
window.location.href="<stripes:url value='${actionBean.actionPath}/' />"+node.data.href;
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,115 +514,6 @@ Search form
margin-top: 1em;
}

/*******************************************************************************
Treetable
*******************************************************************************/

table.treetable span.indenter {
display: inline-block;
margin: 0;
padding: 0;
text-align: right;

/* Disable text selection of nodes (for better D&D UX) */
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
-webkit-user-select: none;

/* Force content-box box model for indenter (Bootstrap compatibility) */
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;

width: 19px;
}

table.treetable span.indenter a {
background-position: left center;
background-repeat: no-repeat;
display: inline-block;
text-decoration: none;
width: 19px;
}

table.treetable {
border: 0px solid #888;
border-collapse: collapse;
margin: .6em 0 1.8em 0;
width: 100%;
}

table.treetable caption {
font-weight: bold;
margin-bottom: .2em;
}

table.treetable thead {
color: white;
background: #2B5494 url(jquery-treetable/images/bg-table-thead.png) repeat-x top left;
}

table.treetable thead tr th {
border: 1px solid #888;
font-weight: normal;
padding: .3em 1em .1em 1em;
text-align: left;
}

table.treetable tbody tr td {
cursor: default;
padding: .3em 1em;
}

table.treetable span {
background-position: center left;
background-repeat: no-repeat;
padding: .2em 0 .2em 1.5em;
}

table.treetable span.file {
background-image: url(jquery-treetable/images/file.png);
}

table.treetable span.folder {
background-image: url(jquery-treetable/images/folder.png);
}

table.treetable tr.collapsed span.indenter a {
background-image: url(jquery-treetable/images/expand.png);
}

table.treetable tr.expanded span.indenter a {
background-image: url(jquery-treetable/images/collapse.png);
}

table.treetable tr.selected {
background-color: #3875d7;
color: #fff;
}

table.treetable tr.collapsed.selected span.indenter a {
background-image: url(jquery-treetable/images/expand-light.png);
}

table.treetable tr.expanded.selected span.indenter a {
background-image: url(jquery-treetable/images/collapse-light.png);
}

table.treetable tr.accept {
background-color: #a3bce4;
color: #fff
}

table.treetable tr.collapsed.accept td span.indenter a {
background-image: url(jquery-treetable/images/expand-light.png);
}

table.treetable tr.expanded.accept td span.indenter a {
background-image: url(jquery-treetable/images/collapse-light.png);
}

/*******************************************************************************
Forms
*******************************************************************************/
Expand Down

0 comments on commit 26e1cb7

Please sign in to comment.