Page 1 of 1

blurring out, help need to get in the right direction please

Posted: Wed Sep 25, 2002 3:09 pm
by coolen
I'm deep ashamed, but I'm totally blurring out the last two days on this problem. I have lost track on where and how to start, But I'm sure there must be codesnippets to help me on this.

The case.

I do have a mysql table that contains the following:

name varchar(64)
type varchar(16)
siblings (blob)

the type field can contain : CONTAINER PLATFORM COMPONENT

The sibblings is a text blob that contains a : seperated array of names like:

name1:name2:name3:name4



I now have a given name as first entry to get to the following:


I need to generate a table as the following:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>test</title>
</head>
<body>
<table BORDER>
<tr>
<td rowspan=5>container1</td>
<td rowspan=3>container2</td>
<td rowspan=2>container3</td>
<td>platform</td>
</tr>

<tr>
<td>container4</td>
<td>platform</td>
</tr>

<tr>
<td>platform</td>
</tr>

<tr>
<td rowspan=2>container5</td>
<td>platform</td>
</tr>

<tr>
<td>container6</td>
<td>platform</td>
</tr>

<tr>
<td rowspan=5>container7</td>
<td>platform</td>
</tr>

<tr>
<td rowspan=3>container8</td>
<td rowspan=2>container9</td>
<td>platform</td>
</tr>

<tr>
<td>platform</td>
</tr>

<tr>
<td>platform</td>
</tr>

<tr>
<td>platform</td>
</tr>

</table>

</body>
</html>


In the above table the container and platform names should be displayed.

So it should look like a node tree, where Containers are the nodes. and platforms are the trees.

The sibblings entry contains names that are also entries in that database.

so the namelist could consist of containername:containername:platformname:platformname for that entry.


Can anybody please give me a start on this ???

Thanx very much

Posted: Wed Sep 25, 2002 3:34 pm
by volka
uhh, you confuse me ;)

1) what is type == 'COMPONENT' ?
2) can you write down the db-table-data for the example-output you provided?
3) it must be this type of representation? nested lists are insufficient?

Posted: Wed Sep 25, 2002 4:04 pm
by coolen
1) Component is not of any importance for the moment. it will be used in a later stage.

2)# MySQL-Front Dump 2.4
#
# Host: localhost Database: test
#--------------------------------------------------------
# Server version 3.23.49-max

USE test;


#
# Table structure for table 'architecture'
#

DROP TABLE IF EXISTS architecture;
CREATE TABLE `architecture` (
`Name` varchar(64) NOT NULL default '',
`Type` varchar(16) NOT NULL default '',
`Sibblings` blob,
PRIMARY KEY (`Name`)
) TYPE=MyISAM;



#
# Dumping data for table 'architecture'
#
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container1", "CONTAINER", "Container2:Container5");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container2", "CONTAINER", "Container3:Platform1");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container3", "CONTAINER", "Platform2:Container4");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container4", "CONTAINER", "Platform3");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container5", "CONTAINER", "Platform4:Container6");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container6", "CONTAINER", "Platform5");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container7", "CONTAINER", "Platform6:Container8:Platform7");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container8", "CONTAINER", "Container9:Platform8");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Container9", "CONTAINER", "Platform9:Platform10");
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform1", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform2", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform3", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform4", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform5", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform6", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform7", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform8", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform9", "PLATFORM", NULL);
INSERT INTO architecture (Name, Type, Sibblings) VALUES("Platform10", "PLATFORM", NULL);


I didn't give the platforms different names as they should have in the earlier provided HTML code. But the DB will show how it basicly should be.


3) No, this table is the first output that we want to show.


The two main Containers (Container1 and Container7) will be provided as being level 0 containers on forehand. So I only need to get down from those two. However there all entries can be n- entries deep

Posted: Thu Sep 26, 2002 3:31 pm
by coolen
:cry: really nobody ???