This commit is contained in:
Lucio Lelii 2009-01-22 13:44:27 +00:00
parent 178061f061
commit 86dfb0f005
4 changed files with 67 additions and 42 deletions

View File

@ -217,11 +217,11 @@ public class XMLUtil {
});
}
//logger.debug("MDFProva: Derivable "+keyTemp+" "+temp);
if(MDFHash.contains(resNative.getString(1))) MDFHash.get(resNative.getString(1)).second.add(tmpEl);
if(MDFHash.contains(resDerivable.getString(1))) MDFHash.get(resDerivable.getString(1)).second.add(tmpEl);
else{
tempArray=new ArrayList<Element>();
tempArray.add(tmpEl);
MDFHash.put(resNative.getString(1), new Couple<Element, ArrayList<Element>>(tmpKeyEl, tempArray) );
MDFHash.put(resDerivable.getString(1), new Couple<Element, ArrayList<Element>>(tmpKeyEl, tempArray) );
}
}

View File

@ -57,7 +57,6 @@ public class LayoutCreation {
try {
ResultSet selectedPortlet= DBInterface.queryDB("select p.name, p.portletclass, p.parent from VRERELATEDFUNCT as vf,PORTLETRELTOFUNCT as pf, PORTLET as p WHERE vf.FUNCID=pf.FUNCID and pf.PORTLETNAME=p.NAME and vf.VREID='"+this.vreId+"';");
while (selectedPortlet.next()){
System.out.println("portlet name:"+selectedPortlet.getString(1)+" portletClass:"+selectedPortlet.getString(2));
AbstractTree child= new TreeLeaf(selectedPortlet.getString(1), selectedPortlet.getString(2) );
String parent= selectedPortlet.getString(3);
System.out.println("parent: "+parent);
@ -73,7 +72,6 @@ public class LayoutCreation {
}catch(Exception e){parent=null;}
}
layoutTree.addPathNode(child);
System.out.println("sono entrato");
}
} catch (SQLException e) {
throw new Exception("Error creating the Portlet Tree",e);

View File

@ -33,6 +33,15 @@ public class TreeLeaf extends AbstractTree{
row.setAttribute("style", "");
row.setAttribute("visible", "true");
row.setAttribute("width", "");
Element column =doc.createElement("column");
column.setAttribute("can-modify", "false");
column.setAttribute("label", "");
column.setAttribute("required-role", "");
column.setAttribute("style", "");
column.setAttribute("visible", "true");
column.setAttribute("width", "");
Element frame = doc.createElement("frame");
frame.setAttribute("can-modify", "false");
frame.setAttribute("inner-padding", "");
@ -46,7 +55,8 @@ public class TreeLeaf extends AbstractTree{
Element portlet= doc.createElement("portletClass");
portlet.setTextContent(this.getPortletClass());
frame.appendChild(portlet);
row.appendChild(frame);
column.appendChild(frame);
row.appendChild(column);
return row;
}

View File

@ -35,51 +35,68 @@ public class TreeNode extends AbstractTree{
@Override
public Element createElement(Document doc) {
Element tab= doc.createElement("tab");
tab.setAttribute("align", "left");
tab.setAttribute("can-modify", "false");
tab.setAttribute("label", "");
tab.setAttribute("order", "50");
tab.setAttribute("outline", "true");
tab.setAttribute("required-role", "");
tab.setAttribute("style", "");
tab.setAttribute("visible", "true");
tab.setAttribute("width", "");
if (this.getNodeName().compareTo("Root")!=0){
Element tab= doc.createElement("tab");
tab.setAttribute("align", "left");
tab.setAttribute("can-modify", "false");
tab.setAttribute("label", "");
tab.setAttribute("order", "50");
tab.setAttribute("outline", "true");
tab.setAttribute("required-role", "");
tab.setAttribute("style", "");
tab.setAttribute("visible", "true");
tab.setAttribute("width", "");
Element title= doc.createElement("title");
title.setAttribute("lang", "en");
title.setTextContent(this.getNodeName());
tab.appendChild(title);
}
if(this.childs.get(0).isLeaf()){
Element subRoot= doc.createElement("table");
subRoot.setAttribute("can-modify", "false");
subRoot.setAttribute("label", "");
subRoot.setAttribute("required-role", "");
subRoot.setAttribute("style", "");
subRoot.setAttribute("visible", "true");
subRoot.setAttribute("width", "");
for (AbstractTree t:this.childs){
subRoot.appendChild(t.createElement(doc));
}
tab.appendChild(subRoot);
Element subRoot;
if(this.childs.get(0).isLeaf()){
subRoot= doc.createElement("table");
subRoot.setAttribute("can-modify", "false");
subRoot.setAttribute("label", "");
subRoot.setAttribute("required-role", "");
subRoot.setAttribute("style", "");
subRoot.setAttribute("visible", "true");
subRoot.setAttribute("width", "");
for (AbstractTree t:this.childs){
subRoot.appendChild(t.createElement(doc));
}
tab.appendChild(subRoot);
}else{
subRoot= doc.createElement("tabbed-pane");
subRoot.setAttribute("can-modify", "false");
subRoot.setAttribute("label", "");
subRoot.setAttribute("required-role", "");
subRoot.setAttribute("style", "sub-menu");
subRoot.setAttribute("visible", "true");
subRoot.setAttribute("width", "");
for (AbstractTree t:this.childs){
subRoot.appendChild(t.createElement(doc));
}
tab.appendChild(subRoot);}
return tab;
}else{
Element root;
root= doc.createElement("tabbed-pane");
root.setAttribute("can-modify", "false");
root.setAttribute("label", "");
root.setAttribute("required-role", "");
root.setAttribute("style", "sub-menu");
root.setAttribute("visible", "true");
root.setAttribute("width", "");
for (AbstractTree t:this.childs){
tab.appendChild(t.createElement(doc));
}
}
Element tabpane= doc.createElement("tabbed-pane");
tabpane.setAttribute("can-modify", "false");
tabpane.setAttribute("label", "");
tabpane.setAttribute("required-role", "");
tabpane.setAttribute("style", "sub-menu");
tabpane.setAttribute("visible", "true");
tabpane.setAttribute("width", "");
tabpane.appendChild(tab);
root.appendChild(t.createElement(doc));}
return root;
}
return tabpane;
}