Website Diagrammer Plugin for DiagramCreator
©2010 Chipp Walters
This plugin allows you to create editable node diagrams using DiagramCreator. It generates a standard DiagramCreator XML file by crawling the website URL designated in the HTTP URL field. Be sure the URL is a valid one and not a redirection of a domain.
This plugin works by downloading the html from the host page, then searching for links, and following them to their destination. If the Level Iterations is greater than 1, the followed links will themselves also be followed, up to the number of iterations you choose. Warning, too many iterations will create an unwieldy chart! Currently, this plugin is limited to only 600 lines of chart data, which will take SOME TIME to render. I have used it to generate over 4000 lines, but DiagramCreator balks on rendering such a large number of nodes. Actually, at 600 nodes, the diagram is almost too large.
After you enter the URL, press the Crawl Web button and the plugin begins the process. It can take up to several minutes to finish.
You can press the STOP button anytime during the web crawling and the data up to that point is saved.
You can press the Generate Diagram button and your data will be transferred to DiagramCreator. If the file is larger than 300 lines, the auto redraw on DiagramCreator will be turned off. This is so you can make any changes you like and manually redraw the diagram.
priv_ResizeControlList Rfield id 1004 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" field id 1006 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" button id 1011 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" field id 1017 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" button id 1019 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" button id 1021 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" button id 1023 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" field id 1025 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" button id 1047 of card id 1002 of stack "C:/My Dropbox/DiagramCreator/dc_plugs/WebDiagram.rev" E--> XML FUNCTIONS function addTagData pTagName, pTagData return "<" & pTagName & ">" & encodeCRs(encodeTabs(pTagData)) & "" & pTagName & ">" end addTagData function encodeAll pStr put encodeCRs(pStr) into pStr put encodeTabs(pStr) into pStr return pStr end encodeAll function decodeAll pStr put decodeCRs(pStr) into pStr put decodeTabs(pStr) into pStr return pStr end decodeAll function encodeCRs pStr replace cr with gCR in pStr return pStr end encodeCRs function decodeCRs pStr replace gCR with cr in pStr return pStr end decodeCRs function encodeTabs pStr replace tab with gTab in pStr return pStr end encodeTabs function decodeTabs pStr replace gTab with tab in pStr return pStr end decodeTabs function delTagData pTagName, pTagData put "<" & pTagName & ">*" into tFilter put "filter pTagData without " & quote & tFilter & quote into tDo do tDo return pTagData end delTagData function getTagData pTagName,pTagData filter pTagData with "*<" & pTagName & ">*" put word 1 to the number of words in pTagData of pTagData into pTagData replace "<" & pTagName & ">" with "" in pTagData replace "" & pTagName & ">" with "" in pTagData return pTagData end getTagData function getTag pTagName,pTagData --> RETRIEVES SINGLE LINE OF TAG INCLUDING TAG AND ELEMENT TEXT filter pTagData with "<" & pTagName & ">*" return word 1 to -1 of pTagData end getTag function getTagName pLine put offset("<",pLine) into tStart put offset(">",pLine) into tEnd return char tStart+1 to tEnd-1 of pLine end getTagName function getAltNumberNodes pTagName,pXML --> RETURNS THE NUMBER OF NODES FOR TAG pTagName IN pXML put "<"& pTagName &">" into tTag put 0 into tCount put 0 into tOffset repeat put offset(tTag,pXML,tOffset) into tStart if tStart = 0 then return tCount add tStart to tOffset add 1 to tCount end repeat retrun tCount end getAltNumberNodes function getAltNumberChildrenNodes pTagName,pTagData --> RETURNS THE NUMBER OF CHILD NODES FOR TAG pTagName IN pXML put getAltTagData(pTagName,pTagData) into tXML put "<" into tTag put 0 into tCount put 0 into tOffset repeat put offset("<",tXML) into tStart if tStart=0 then exit repeat put offset("",tXML) into tEnd if tEnd = 0 then exit repeat delete char tStart to tEnd of tXML add 1 to tCount end repeat return tCount end getAltNumberChildrenNodes function getAltChildNode pTagName,pXML,pNodeNum --> RETURNS XML OF CHILD pNodeNum OF TAG pTagName --> USE WHEN YOU DON'T KNOW ALL THE NAME OF CHILDREN put getAltTagData(pTagName,pXML) into tXML put "" into tTxt repeat pNodeNum times put offset("<",tXML) into tStart if tStart = 0 then return "" put offset(">",tXML) into tEnd if tEnd = 0 then return "" put char tStart+1 to tEnd-1 of tXML into tTagName put offset("" & tTagName & ">",tXML) into tEnd put the number of chars in ("" & tTagName & ">") into tLength put char tStart to (tEnd+tLength-1) of tXML into tTxt put char (tEnd+tLength+1) to -1 of tXML into tXML end repeat return tTxt end getAltChildNode function getAltTagData pTagName,pTagData,pTagInstance --> RETURNS ALL DATA INSIDE OF THE INSTANCE pTagInstance OF TAG pTagName FROM THE pTagData if pTagInstance is "" then put 1 into pTagInstance put 0 into tOffset repeat pTagInstance times put offset("<"& pTagName &">",pTagData,tOffset) into tStart if tStart = 0 then return "" add tStart to tOffset end repeat delete char 1 to tOffset + the length of pTagName +1 of pTagData put offset(""& pTagName &">",pTagData) into tEnd delete char tEnd to the length of pTagData of pTagData replace numToChar(13) with "" in pTagData return word 1 to the number of words of pTagData of pTagData end getAltTagData function getAltElementText pTagName,pTagData,pTagInstance --> RETURNS THE ELEMENT TEXT OF THE INSTANCE pTagInstance OF TAG pTagName FROM THE pTagData --> THE ELEMENT TEXT IS DEFINED AS THE TEXT AFTER THE TAG AND BEFORE ANY OTHER TAGS if pTagInstance is "" then put 1 into pTagInstance put 0 into tOffset repeat pTagInstance times put offset("<"& pTagName &">",pTagData,tOffset) into tStart if tStart = 0 then return "" add tStart to tOffset end repeat delete char 1 to tOffset + the length of pTagName +1 of pTagData put offset("<",pTagData) into tEnd delete char tEnd to the length of pTagData of pTagData replace numToChar(13) with "" in pTagData return word 1 to the number of words of pTagData of pTagData end getAltElementText --> ALTLAYOUT SCRIPTS --> DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING local lAltChecking,lAltOldWH,lPlatform local lHasDividerBeenUsed on preOpenStack --> AUTO-GENERATED BY altLayout Manager initAltLayoutLib end preOpenStack on preOpenCard --> COMMENT THIS SCRIPT OUT FOR SINGLE CARD STACKS --> THIS SCRIPT WILL AUTO LAYOUT FOR EACH CARD BEFORE OPENING --> THIS WAY ONLY THE CONTROLS ON A GIVEN CARD ARE MANANAGED AT ONE TIME --> RESULTING IN MUCH FASTER PERFORMANCE --> IF YOU HAVE A preOpenCard SCRIPT IN YOUR CARD, THEN BE SURE AND PASS IT --> EDIT THIS SCRIPT HOW YOU LIKE put the width of this stack into pW put the height of this stack into pH send "resizeStack pW,pH,pW,pH" to this card in 50 millisecs end preOpenCard on resizeStack pNewW,pNewH,pOldW,pOldH --> AUTO-GENERATED BY altLayout Manager --> CAPTURE FIRST pOldW,pOldH if lAltOldWH is empty then put pOldW,pOldH into lAltOldWH get the priv_ResizeControlList of this stack repeat for each line L in it if exists(L) then put the altLayoutManager["altCard"] of L into tCard if word 1 of tCard is not "card" then --> IT IS A CONTROL WHICH IS PART OF A BACKGROUND --> IS THE BACKGROUND ON THIS CD? if tCard is among the lines of the groupIDs of this card then altSetRect L,(the altLayoutManager["altCmd"] of L) end if else if tCard = the name of this card then altSetRect L,(the altLayoutManager["altCmd"] of L) end if end if end if end repeat if lAltChecking <> true then CheckMouseState end if pass resizeStack end resizeStack --> END AUTO-GENERATED BY altLayout Manager function checkHasDividerBeenUsed return lHasDividerBeenUsed end checkHasDividerBeenUsed() on setHasDividerBeenUsed pFlag put pFlag into lHasDividerBeenUsed end setHasDividerBeenUsed on initAltLayoutLib switch the platform case "MacOS" put "MacOSX" into lPlatform altSetLayoutMode "MacOSX" break case "Win32" put "WinXP" into lPlatform altSetLayoutMode "WinXP" break default put "Other" into lPlatform altSetLayoutMode "Other" break end switch put false into lHasDividerBeenUsed end initAltLayoutLib on altSetLayoutMode pMode put the short name of this stack into tTheStackName if tTheStackName is "LayoutManager" then answer "Can't edit the Layout Manager stack!" exit to top end if replace space with "" in pMode altInitStack pMode altInitControls pMode end altSetLayoutMode on altInitStack pMode put the short name of this stack into tTheStackName if pMode is "WinXP" then if there is a btn "altDrag" then show btn "altDrag" end if else if there is a btn "altDrag" then hide btn "altDrag" end if end if --> RESIZE STACK put the rect of this stack into tRect --> MINWIDTH put pMode & "altMinWidth" into tProp if "altMinWidth" is among the lines of the customKeys of this stack then if tProp is among the lines of the customKeys of this stack then put "put the " & tProp & " of this stack into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMinWidth of this stack to tPropValue end if end if set the minWidth of this stack to the altMinWidth of this stack end if --> MINHEIGHT put pMode & "altMinHeight" into tProp if "altMinHeight" is among the lines of the customKeys of this stack then if tProp is among the lines of the customKeys of this stack then put "put the " & tProp & " of stack " & quote & tTheStackName & quote & " into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMinHeight of this stack to tPropValue end if end if set the minHeight of this stack to the altMinHeight of this stack #set the height of this stack to the altMinHeight of this stack end if --> MAXWIDTH put pMode & "altMaxWidth" into tProp if "altMaxWidth" is among the lines of the customKeys of this stack then if tProp is among the lines of the customKeys of this stack then put "put the " & tProp & " of stack " & quote & tTheStackName & quote & " into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMaxWidth of this stack to tPropValue end if end if set the maxWidth of this stack to the altMaxWidth of this stack #set the width of this stack to the altMaxWidth of this stack end if --> MAXHEIGHT put pMode & "altMaxHeight" into tProp if "altMaxHeight" is among the lines of the customKeys of this stack then if tProp is among the lines of the customKeys of this stack then put "put the " & tProp & " of stack " & quote & tTheStackName & quote & " into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMaxHeight of this stack to tPropValue end if end if set the maxHeight of this stack to the altMaxHeight of this stack #set the height of this stack to the altMaxHeight of this stack end if --> SET THE STACK RECT USING MIN NUMBERS set the rect of this stack to \ item 1 of tRect, \ item 2 of tRect, \ item 1 of tRect + the minWidth of this stack, \ item 2 of tRect + the minHeight of this stack end altInitStack on altInitControls pMode --> SET CONTROL RECTS AND BEHAVIOR put the short name of this stack into tStackName put the environment into tEnvironment --> NEVER WALK THRU CONTROLS...JUST USE CONTROL LIST if tEnvironment is "development" then --> WALK THRU CONTROLS IS SLOWER BUT MORE ACCURATE makeControlsList end if --> WALK THRU CONTROL LIST AND SET LOC put the altResizeControlList of this stack into tControlList --> CORRECT STACK NAMES put the effective fileName of this stack into tStackName replace "Website Diagrammer Plugin for DiagramCreator
©2010 Chipp Walters
This plugin allows you to create editable node diagrams using DiagramCreator. It generates a standard DiagramCreator XML file by crawling the website URL designated in the HTTP URL field. Be sure the URL is a valid one and not a redirection of a domain.
This plugin works by downloading the html from the host page, then searching for links, and following them to their destination. If the Level Iterations is greater than 1, the followed links will themselves also be followed, up to the number of iterations you choose. Warning, too many iterations will create an unwieldy chart! Currently, this plugin is limited to only 600 lines of chart data, which will take SOME TIME to render. I have used it to generate over 4000 lines, but DiagramCreator balks on rendering such a large number of nodes. Actually, at 600 nodes, the diagram is almost too large.
After you enter the URL, press the Crawl Web button and the plugin begins the process. It can take up to several minutes to finish.
You can press the STOP button anytime during the web crawling and the data up to that point is saved.
You can press the Generate Diagram button and your data will be transferred to DiagramCreator. If the file is larger than 300 lines, the auto redraw on DiagramCreator will be turned off. This is so you can make any changes you like and manually redraw the diagram.
<