Patience? No, it only takes seconds to run.
First fruits of a long process? Yes.
Here is the process information flow diagram (programs in parentheses):
Code: Select all
/usr/share/Gambas3/info/gb.*
|
V
(Scanner)
|
V
LoadFiles.tsv (Text Editing)
| |
V V
(Loader) <-- LoadDB_Vault.SQL (Text Edit Field Info) Database Diagram
| | |
V V V
SQLiteDatabase <-- (DB Creator) <-- CreateDB_Vault.SQL <-- (Diagram Parser)
|
V
(Reporter) <-- Query_Vault.SQL <-- (SQLite + Text Editing)
| +- Report_Vault.HTM <-- (Text Editing)
V
HTML Files
Here is the current Database Diagram:
Code: Select all
pd_vendors pd_roots wk_class_flags
0 1 0
| | |
M M |
pd_tags pd_projects wk_components |
1 1 1 1 0 1 1 1 1 |
| +-------+ | | | | +--------+ | | | +---+
M M M | | M M M M M M |
pd_subtags pd_project_tags | | pd_files pd_project_components wk_classes |
1 | | 1 1 1 1 1 0 |
| +-----------+ | | | +-----------+ +----+ | +---+
M M | | M M M |
pd_project_subtags +-------+ | cs_routines cs_class_usage |
| | 1 1 |
| +----+ | | |
M | M | |
cs_shared_libs | cs_lines | wk_member_types |
1 1 | 1 1 1 1 | 1 |
| | | | | | | | | |
| M M | | | M M M M
| cs_lib_usage | | | cs_calls wk_members
| | | | 1
| | | +-----+ +--------+
M | | M M
cs_lib_function | | cs_member_usage wk_keywords
1 | | 1
| | +-------+ +---------+
M M M M
cs_function_usage cs_keyword_usage
It's evolved a bit since the last time I posted it. There are three regions to the database:
wk - Wiki Information
pd - Project Definition
cs - Code Scanner
Currently I have the wk region loaeded, working on the pd, not started on the cs.
When I am done, and the projects/code being scanned are all the projects in the Software Farm, the database will be able to report all sorts of useful information. This class listing is just the first. It is a simple query on the wk_classes and wk_components tables.
Code: Select all
SELECT wk_classes.name AS ClassName,
wk_components.name AS ComponentName,
wk_classes.inherits_name AS InheritsName
FROM wk_classes
INNER JOIN wk_components
ON wk_classes.wk_components_fk = wk_components.id
ORDER BY ClassName, ComponentName
Then the program simply brute force scans the resulting list for each letter:
'---- Gather the Values
For r = 0 To theClassNames.Max
If Left(theClassNames[r]) = theLetter Then
theEntry_Row.Add(r)
Endif
Next
For r = 0 To theClassNames.Max
If Left(theClassNames[r]) = "." Then
If Mid(theClassNames[r], 2, 1) = theLetter Then
theEntry_Row.Add(r)
Endif
Endif
Next
For r = 0 To theClassNames.Max
If Left(theClassNames[r]) = "_" Then
If Mid(theClassNames[r], 2, 1) = theLetter Then
theEntry_Row.Add(r)
Endif
Endif
Next
'---- Find the One third Mark
Dim theThird As Integer
theThird = Int((theEntry_Row.Count + 2) / 3)
The broader purpose of this whole exercise is to build a web application and a desktop application which will find code examples from the Software Farm indexed by the components/classes.
Imagine that if you clicked on one of those links, not only would you get a list of members (properties,methods,events) of the class, but also a list of all the Software Farm projects which use that class. Click on a project name and it takes you to a page showing you code excerpts around the class usage.
I have attached the last program in the process for those who are interested in seeing how it works. The included database is just the wk tables to keep it as small as possible.
So, this is really a matter of perserverence over patience. The Vault files are like a Settings file that can be mulitple line with replaceable parameters. The code is a work in progress and I will be formally announcing it soon, but you can see how the first draft works in the attached files. Since they are text files, you can bring them into the IDE and use them as if they are alternative format source files.
Ced
P.S. Cogier, et al, I would be delighted if you downloaded this demo, modified the HTML to fit your site style, and posted a copy.
P.P.S. When you unzip the demo, there is a file called CreateUniqueWiki_Vault.SQL included. You should open up the FarmDB.sqlite database, paste the contents of the SQL file in the query execute panet and run it. This will create a set of new derived tables of unique identifiers for the wk tables.