1 Welcome to the CreativeIT wiki!
Please join and contribute to this community resource.
1.1 Map of the wiki
<script type="text/javascript"
src="/bin/downloadrev/Main/WikiMap2/flashobject.js?rev=1.2">
</script>
<div id="flashcontent_sitemap.mm">
Flash plugin or Javascript are turned off.
Activate both and reload to view the mindmap
</div><script type="text/javascript">
var fo = new
FlashObject("/bin/downloadrev/Main/WikiMap2/visorFreemind.swf?rev=1.3","visorFreeMind", "100%", "450", 6, "#9999ff");
fo.addParam("quality", "high");
fo.addParam("bgcolor", "#ffffff");
fo.addVariable("openUrl", "_self");
fo.addVariable("initLoadFile", "/bin/downloadrev/Main/WikiMap2/sitemap.mm?rev=1.28");
fo.addVariable("startCollapsedToLevel","1");
fo.addVariable("startFit","true");
fo.write("flashcontent_sitemap.mm");
</script>
<%
import java.io.StringReader
import java.util.HashMap
import com.xpn.xwiki.doc.XWikiAttachment
import groovy.xml.MarkupBuilder
def generateXmlForChildNode(nodeSpace, nodeName, xmlBuilder)
{
def fullNodeName = nodeSpace+"."+nodeName
def attachment = xwiki.getDocument(fullNodeName).getAttachmentURL("pageicon.png", "download", "width=50")
def nodeHtml = nodeName
if (attachment) {
nodeHtml = "<html>"+nodeName+"<img src=\""+attachment+"\" width=\"50px\"></html>"
}
xmlBuilder.node(LINK:xwiki.getURL(fullNodeName, "view"), TEXT:nodeHtml, STYLE:"bubble") {
xmlBuilder.edge(STYLE:"sharp_bezier", WIDTH:"4")
def sql = "select distinct doc.web, doc.name, doc.parent from XWikiDocument as doc where doc.parent='" + xwiki.sqlfilter(fullNodeName) + "'" + "and doc.space='" + nodeSpace + "'"
def doclist = xwiki.search(sql)
for(item in doclist) {
generateXmlForChildNode(item[0], item[1], xmlBuilder)
}
}
}
def generateMap(firstNodeSpace, firstNodeName, xmlBuilder)
{
xmlBuilder.map() {
generateXmlForChildNode(firstNodeSpace, firstNodeName, xmlBuilder)
}
}
if (xwiki.hasAdminRights())
{
println "[Update the Map>" + doc.fullName + "?update=1]"
if (request.get("update") != null)
{
print "Start mindmap generation... "
def writer = new StringWriter()
def xmlBuilder = new MarkupBuilder(writer)
generateMap("Main", "WebHome", xmlBuilder)
def attachmentName = "sitemap.mm"
def attachment = doc.getDocument().getAttachment(attachmentName)
if (!attachment)
{
attachment = new XWikiAttachment(doc.getDocument(), attachmentName)
doc.getDocument().getAttachmentList().add(attachment)
}
attachment.setContent(writer.toString().getBytes())
doc.getDocument().saveAttachmentContent(attachment, context.getContext())
doc.save()
println "done"
response.sendRedirect(xwiki.getURL(doc.getName(),"view"))
}
}
%>