[rkward-cvs] SF.net SVN: rkward:[3871] trunk/rkward/rkward/rbackend/rpackages/rkwarddev

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Fri Sep 30 21:05:49 UTC 2011


Revision: 3871
          http://rkward.svn.sourceforge.net/rkward/?rev=3871&view=rev
Author:   m-eik
Date:     2011-09-30 21:05:49 +0000 (Fri, 30 Sep 2011)
Log Message:
-----------
rkwarddev: redesigned rk.XML.plugimap() big time, supports all pluginmap options now

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.components.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.context.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.entry.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.hierarchy.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.menu.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.pluginmap.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.components.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.context.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.entry.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.hierarchy.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.menu.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.pluginmap.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-30 21:05:49 UTC (rev 3871)
@@ -1,10 +1,14 @@
 ChangeLog for package rkwarddev
 
 ## 0.02-3 (2011-09-30)
-  - tuned rk.plugin.skeleton() to only skip file writing if they exist
   - added functions rk.XML.attribute(), rk.XML.component(), rk.XML.components(), rk.XML.context(),
     rk.XML.entry(), rk.XML.hierarchy(), rk.XML.menu() and rk.XML.require()
-
+  - rk.plugin.skeleton() and rk.XML.pluginmap() now use the new functions, which makes them much more flexible
+  - added option "menu" to rk.plugin.skeleton()
+  - added options "require", "x11.context", "import.context" and "hints" to rk.XML.pluginmap()
+  - removed now superfluous option "plugin.dir" from rk.XML.pluginmap()
+  - tuned rk.plugin.skeleton() to only skip file writing if they exist
+  
 ## 0.02-2 (2011-09-29)
   - added "load" and "show" options to rk.plugin.skeleton() to call rk.load.pluginmaps() and the plugin itself
   - added function rk.build.plugin()

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.components.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.components.R	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.components.R	2011-09-30 21:05:49 UTC (rev 3871)
@@ -6,7 +6,7 @@
 #' @return A list of objects of class \code{XiMpLe.node}.
 #' @export
 #' @seealso
-#'		\code{\link[rkwarddev:rk.XML.pluginmap]{rk.XML.pluginmap}}
+#'		\code{\link[rkwarddev:rk.XML.pluginmap]{rk.XML.pluginmap}},
 #'		\code{\link[rkwarddev:rk.XML.component]{rk.XML.component}}
 #' @examples
 #' test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.context.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.context.R	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.context.R	2011-09-30 21:05:49 UTC (rev 3871)
@@ -7,6 +7,10 @@
 #' @param id Character string, either "x11" or "import".
 #' @return A list of objects of class \code{XiMpLe.node}.
 #' @export
+#' @seealso
+#'		\code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}},
+#'		\code{\link[rkwarddev:rk.XML.entry]{rk.XML.entry}},
+#'		\code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
 #' @examples
 #' test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
 #' test.entry <- rk.XML.entry(test.component)

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.entry.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.entry.R	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.entry.R	2011-09-30 21:05:49 UTC (rev 3871)
@@ -7,7 +7,10 @@
 #' @return A list of objects of class \code{XiMpLe.node}.
 #' @export
 #' @seealso
-#'		\code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}}
+#'		\code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}},
+#'		\code{\link[rkwarddev:rk.XML.hierarchy]{rk.XML.hierarchy}},
+#'		\code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
+#'		\code{\link[rkwarddev:rk.XML.components]{rk.XML.components}}
 #' @examples
 #' test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
 #' test.entry <- rk.XML.entry(test.component)

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.hierarchy.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.hierarchy.R	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.hierarchy.R	2011-09-30 21:05:49 UTC (rev 3871)
@@ -7,7 +7,10 @@
 #' @return A list of objects of class \code{XiMpLe.node}.
 #' @export
 #' @seealso
-#'		\code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}}
+#'		\code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}},
+#'		\code{\link[rkwarddev:rk.XML.entry]{rk.XML.entry}},
+#'		\code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
+#'		\code{\link[rkwarddev:rk.XML.components]{rk.XML.components}}
 #' @examples
 #' test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
 #' test.entry <- rk.XML.entry(test.component)

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.menu.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.menu.R	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.menu.R	2011-09-30 21:05:49 UTC (rev 3871)
@@ -1,6 +1,6 @@
 #' Create XML "menu" node for RKWard plugins
 #'
-#' This function will create a menu node for entry sections.
+#' This function will create a menu node for hierarchy sections.
 #' Use same \code{id} values to place entries in the same menu.
 #' 
 #' @param label Character string, a label for the menu.
@@ -13,7 +13,10 @@
 #' @return A list of objects of class \code{XiMpLe.node}.
 #' @export
 #' @seealso
-#'		\code{\link[rkwarddev:rk.XML.menus]{rk.XML.menus}}
+#'		\code{\link[rkwarddev:rk.XML.hierarchy]{rk.XML.hierarchy}},
+#'		\code{\link[rkwarddev:rk.XML.entry]{rk.XML.entry}},
+#'		\code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
+#'		\code{\link[rkwarddev:rk.XML.components]{rk.XML.components}}
 #' @examples
 #' test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
 #' test.entry <- rk.XML.entry(test.component)

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.pluginmap.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.pluginmap.R	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.pluginmap.R	2011-09-30 21:05:49 UTC (rev 3871)
@@ -1,102 +1,235 @@
 #' Write a pluginmap file for RKWard
 #'
 #' @param name Character string, name of the plugin.
-#' @param about A list with descriptive information on the plugin,its authors and dependencies.
+#' @param about Either an object of class \code{XiMpLe.node} to be pasted as the \code{<about>} section,
+#'		or a list with descriptive information on the plugin,its authors and dependencies.
 #'		See \code{link[XiMpLe:rk.XML.about]{rk.XML.about}} for details! Skipped if \code{NULL}.
-#' @param components A character vector with at least one plugin component file name,
-#'		ending with ".xml".
-#' @param plugin.dir Character string, relative path to the component XML and JS files.
-#' @param hierarchy A character vector with instructions where to place the plugin in the menu hierarchy,
-#'		one string for each included component. Valid values are \code{"analysis"},  \code{"plots"} and  
-#'		\code{"data"}. To place your dialogs somewhere else, edit the pluginmap manually.
+#' @param components Either an object of class \code{XiMpLe.node} to be pasted as the \code{<components>} section (see
+#'		\code{\link[rkwarddev:rk.XML.components]{rk.XML.components}} for details). Or a character vector with at least
+#'		one plugin component file name, relative path from the pluginmap file and ending with ".xml".
+#' @param hierarchy Either an object of class \code{XiMpLe.node} to be pasted as the \code{<hierarchy>} section (see
+#'		\code{\link[rkwarddev:rk.XML.hierarchy]{rk.XML.hierarchy}} for details). Or a character vector with instructions
+#'		where to place the plugin in the menu hierarchy, one string for each included component. Valid values are
+#'		\code{"file"}, \code{"edit"}, \code{"view"}, \code{"workspace"}, \code{"run"}, \code{"data"},
+#'		\code{"analysis"}, \code{"plots"}, \code{"distributions"}, \code{"windows"}, \code{"settings"} and \code{"help"}.
+#'		Anything else will place it in a "test" menu.
+#' @param require Either a (list of) objects of class \code{XiMpLe.node} to be pasted as a \code{<require>} section (see
+#'		\code{\link[rkwarddev:rk.XML.require]{rk.XML.require}} for details). Or a character vector with at least
+#'		one .pluginmap filename to be included in this one.
+#' @param x11.context An object of class \code{XiMpLe.node} to be pasted as a \code{<context id="x11">} section, see
+#'		\code{\link[rkwarddev:rk.XML.context]{rk.XML.context}} for details.
+#' @param import.context An object of class \code{XiMpLe.node} to be pasted as the \code{<context id="import">} section, see
+#'		\code{\link[rkwarddev:rk.XML.context]{rk.XML.context}} for details.
 #' @param clean.name Logical, if \code{TRUE}, all non-alphanumeric characters except the underscore (\code{"_"}) will be removed from \code{name}.
+#' @param hints Logical, if \code{TRUE} and you leave out optional entries (like \code{about=NULL}), dummy sections will be added as comments.
 #' @export
 
-rk.XML.pluginmap <- function(name, about=NULL, components, plugin.dir="plugins", hierarchy="analysis", clean.name=TRUE){
+rk.XML.pluginmap <- function(name, about=NULL, components, hierarchy="test",
+	require=NULL, x11.context=NULL, import.context=NULL, clean.name=TRUE, hints=FALSE){
+	name.orig <- name
 	if(isTRUE(clean.name)){
 		# to besure, remove all non-character symbols from name
-		name.orig <- name
 		name <- clean.name(name)
 	} else {}
 
-	# .pluginmap has three children in <document>:
-	# - about
-	# - components
-	# - hierarchy
+	# .pluginmap has these children in <document>:
+	# - about (optional)
+	# - require (optional, multiple)
+	# - components (once)
+	#   - component
+	#     - attribute
+	# - hierarchy (once)
+	#   - menu
+	#     - entry
+	# - context (optional, "x11")
+	#   - menu
+	#     - entry
+	# - context (optional, "import")
+	#   - menu
+	#     - entry
+
+	## about section
 	if(!is.null(about)){
-	about.XML <- rk.XML.about(
-		name=name.orig,
-		author=about[["author"]],
-		about=about[["about"]],
-		dependencies=about[["dependencies"]],
-		package=about[["package"]],
-		pluginmap=about[["pluginmap"]])
+		if(inherits(about, "XiMpLe.node")){
+			about.node.name <- about at name
+			# check if this is *really* a about section, otherwise quit and go dancing
+			if(!identical(about.node.name, "about")){
+				stop(simpleError("I don't know what this is, but 'about' is not an about section!"))
+			} else {
+				# initialize all.children list
+				all.children <- list(about)
+			}
+		} else {
+			about.XML <- rk.XML.about(
+				name=name.orig,
+				author=about[["author"]],
+				about=about[["about"]],
+				dependencies=about[["dependencies"]],
+				package=about[["package"]],
+				pluginmap=about[["pluginmap"]])
+			# initialize all.children list
+			all.children <- list(about.XML)
+		}
 	} else {
-		about.XML <- new("XiMpLe.node",
-		name="!--",
-		value="<about></about>")
+		if(isTRUE(hints)){
+			about.XML <- new("XiMpLe.node",
+				name="!--",
+				value="<about></about>")
+			# initialize all.children list
+			all.children <- list(about.XML)
+		} else {
+			# initialize all.children list
+			all.children <- list()
+		}
 	}
 
-	components.XML <- new("XiMpLe.node",
-		name="components",
-		children=sapply(components, function(this.comp){
-				new("XiMpLe.node",
-					name="component",
-					attributes=list(
-						type="standard",
-						# if this ID get's a change, also change it in rk.plugin.skeleton(show=TRUE)!
-						id=paste(name, ".", gsub(".xml", "", this.comp), sep=""),
-						file=paste(plugin.dir, "/", this.comp, sep=""),
-						label=gsub(".xml", "", this.comp))
-				)})
-	)
+	## require section
+	if(!is.null(require)){
+		# check if this is *really* require nodes
+		for(this.child in child.list(require)){
+				if(inherits(this.child, "XiMpLe.node")){
+					node.name <- this.child at name
+					if(!identical(node.name, "require")){
+						stop(simpleError("I don't know what this is, but 'require' is not made of require nodes!"))
+					} else {
+						all.children[[length(all.children)+1]] <- this.child
+					}
+				} else {
+					if(grepl(".pluginmap", this.child)){
+						all.children[[length(all.children)+1]] <- rk.XML.require(file=this.child)
+					} else {
+						stop(simpleError("Only .pluginmap files are valid for require nodes!"))
+					}
+				}
+			}
+	} else {
+		if(isTRUE(hints)){
+			require.XML <- new("XiMpLe.node",
+				name="!--",
+				value="<require file=\"path/file.pluginmap\" />")
+			all.children[[length(all.children)+1]] <- require.XML
+		} else {}
+	}
 
-	hier.comp.XML <- unlist(sapply(1:length(hierarchy), function(this.dial){
-		this.comp <- components[this.dial]
-		this.hier <- hierarchy[this.dial]
-		entry.XML <- new("XiMpLe.node",
-			name="menu",
-			attributes=list(
-				id=paste("menu_", name, ".", gsub(".xml", "", this.comp), sep=""),
-				label=name.orig),
-			children=list(new("XiMpLe.node",
-				name="entry",
-				attributes=list(
-					component=paste(name, ".", gsub(".xml", "", this.comp), sep=""))
-				)))
+	## components section
+	if(inherits(components, "XiMpLe.node")){
+		components.node.name <- components at name
+		# check if this is *really* a components section, otherwise quit and go dancing
+		if(!identical(components.node.name, "components")){
+			stop(simpleError("I don't know what this is, but 'components' is not a components section!"))
+		} else {}
+		all.children[[length(all.children)+1]] <- components
+		# get the IDs for hierarchy section
+		component.IDs <- sapply(components at children, function(this.comp){this.comp at attributes$id})
+	} else {
+		components.XML <- rk.XML.components(
+			as.list(sapply(components, function(this.comp){
+				# remove any directory names and .EXT endings
+				xml.basename <- gsub("(.*/)?([[:alnum:]]*).+(.*)?", "\\2", this.comp, perl=TRUE)
+				rk.XML.component(
+					label=xml.basename,
+					file=this.comp,
+					# if this ID get's a change, also change it in rk.plugin.skeleton(show=TRUE)!
+					id.name=auto.ids(paste(name, xml.basename, sep=""), prefix=ID.prefix("component"), chars=25))
+				}))
+		)
+		all.children[[length(all.children)+1]] <- components.XML
+		# get the IDs for hierarchy section
+		component.IDs <- sapply(components.XML at children, function(this.comp){this.comp at attributes$id})
+	}
 
-		if(identical(this.hier, "plots")){
-			hier.XML <- new("XiMpLe.node",
-				name="menu",
-				attributes=list(
-					id="plots",
-					label="Plots"),
-				children=child.list(entry.XML))
-		} else if(identical(this.hier, "data")){
-			hier.XML <- new("XiMpLe.node",
-				name="menu",
-				attributes=list(
-					id="data",
-					label="Data"),
-				children=child.list(entry.XML))
+	## hierachy section
+	if(inherits(hierarchy, "XiMpLe.node")){
+		hierarchy.node.name <- hierarchy at name
+		# check if this is *really* a hierarchy section, otherwise quit and go dancing
+		if(!identical(hierarchy.node.name, "hierarchy")){
+			stop(simpleError("I don't know what this is, but 'hierarchy' is not a hierarchy section!"))
+		} else {}
+		all.children[[length(all.children)+1]] <- hierarchy
+	} else {
+		# check if the numbers fit
+		if(length(hierarchy) != length(component.IDs)){
+			stop(simpleError("Length of 'hierarchy' and number of components must be the same!"))
+		} else {}
+		# predefined menu points
+		main.menu <- c(file="File", edit="Edit", view="View", workspace="Workspace", run="Run",
+			data="Data", analysis="Analysis", plots="Plots", distributions="Distributions",
+			windows="Windows", settings="Settings", help="Help")
+
+		hier.comp.XML <- sapply(1:length(hierarchy), function(this.dial){
+			this.comp <- component.IDs[this.dial]
+			this.hier <- hierarchy[this.dial]
+
+			entry.XML <- rk.XML.menu(
+				label=name.orig,
+				nodes=rk.XML.entry(component=this.comp),
+				id.name=auto.ids(paste(name, this.comp, sep=""), prefix=ID.prefix("menu"), chars=12))
+
+			if(this.hier %in% names(main.menu)){
+				hier.XML <- rk.XML.menu(
+					label=main.menu[this.hier],
+					nodes=entry.XML,
+					id.name=this.hier)
+			} else {
+				hier.XML <- rk.XML.menu(
+					label="Test",
+					nodes=entry.XML,
+					id.name="test")
+			}
+			return(hier.XML)
+		})
+		all.children[[length(all.children)+1]] <- rk.XML.hierarchy(hier.comp.XML)
+	}
+
+	## context sections
+	if(!is.null(x11.context)){
+		# check if this is *really* a context node for x11
+		if(inherits(x11.context, "XiMpLe.node")){
+			node.name <- x11.context at name
+			ctxt.name <- x11.context at attributes$id
 		} else {
-			hier.XML <- new("XiMpLe.node",
-				name="menu",
-				attributes=list(
-					id="analysis",
-					label="Analysis"),
-				children=child.list(entry.XML))
+			node.name <- ctxt.name <- "buhahahahaa"
 		}
-	}))
+		if(!identical(node.name, "context") | !identical(ctxt.name, "x11")){
+			stop(simpleError("I don't know what this is, but 'x11.context' is not a context node for x11!"))
+		} else {
+			all.children[[length(all.children)+1]] <- x11.context
+		}
+	} else {
+		if(isTRUE(hints)){
+			context.x11.XML <- new("XiMpLe.node",
+				name="!--",
+				value="<context id=\"x11\"></context>")
+			all.children[[length(all.children)+1]] <- context.x11.XML
+		} else {}
+	}
+	# import
+	if(!is.null(import.context)){
+		# check if this is *really* a context node for import
+		if(inherits(import.context, "XiMpLe.node")){
+			node.name <- import.context at name
+			ctxt.name <- import.context at attributes$id
+		} else {
+			node.name <- ctxt.name <- "buhahahahaa"
+		}
+		if(!identical(node.name, "context") | !identical(ctxt.name, "import")){
+			stop(simpleError("I don't know what this is, but 'import.context' is not a context node for import!"))
+		} else {
+			all.children[[length(all.children)+1]] <- import.context
+		}
+	} else {
+		if(isTRUE(hints)){
+			context.import.XML <- new("XiMpLe.node",
+				name="!--",
+				value="<context id=\"import\"></context>")
+			all.children[[length(all.children)+1]] <- context.import.XML
+		} else {}
+	}
 
-	hierarchy.XML <- new("XiMpLe.node",
-		name="hierarchy",
-		children=hier.comp.XML)
-
 	top.doc <- new("XiMpLe.node",
 		name="document",
 		attributes=list(base_prefix="", namespace="rkward", id=paste(name, "_rkward", sep="")),
-		children=list(about.XML, components.XML, hierarchy.XML)
+		children=all.children
 	)
 
 	pluginmap <- new("XiMpLe.doc",

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-30 21:05:49 UTC (rev 3871)
@@ -23,6 +23,10 @@
 #'		Defaults to \code{TRUE}.
 #' @param lazyLoad Logical, whether the package should be prepared for lazy loading or not. Should be left \code{TRUE},
 #'		unless you have very good reasons not to.
+#' @param menu A character string with instructions where to place the plugin in the menu hierarchy, Valid values are
+#'		\code{"file"}, \code{"edit"}, \code{"view"}, \code{"workspace"}, \code{"run"}, \code{"data"},
+#'		\code{"analysis"}, \code{"plots"}, \code{"distributions"}, \code{"windows"}, \code{"settings"} and \code{"help"}.
+#'		Anything else will place it in a "test" menu.
 #' @param JS.prep A character string with JavaScript code to be included in the \code{preprocess()} function. This string will be
 #'		pasted as-is, see \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.
 #' @param JS.calc A character string with JavaScript code to be included in the \code{calculate()} function. This string will be
@@ -106,7 +110,7 @@
 #' }
 
 rk.plugin.skeleton <- function(name, about=NULL, path=tempdir(), dialog=NULL, wizard=NULL, logic=NULL, snippets=NULL,
-	provides=c("logic", "dialog"), dial.require=c(), overwrite=FALSE, tests=TRUE, lazyLoad=TRUE,
+	provides=c("logic", "dialog"), dial.require=c(), overwrite=FALSE, tests=TRUE, lazyLoad=TRUE, menu="test",
 	JS.prep=NULL, JS.calc=NULL, JS.prnt=NULL, create=c("pmap", "xml", "js", "rkh", "desc"), edit=FALSE, load=FALSE, show=FALSE){
 	# to besure, remove all non-character symbols from name
 	name.orig <- name
@@ -226,9 +230,9 @@
 			XML.pluginmap <- rk.XML.pluginmap(
 				name=name.orig,
 				about=about,
-				components=paste(name, ".xml", sep=""),
-				plugin.dir="plugins",
-				hierarchy="analysis")
+				components=paste("plugins/", name, ".xml", sep=""),
+				hierarchy=as.character(menu),
+				hints=TRUE)
 			cat(pasteXMLTree(XML.pluginmap, shine=2), file=plugin.pluginmap)
 		} else {}
 		if(isTRUE(edit)){
@@ -238,7 +242,8 @@
 			rk.load.pluginmaps(plugin.pluginmap)
 			if(isTRUE(show)){
 				# call the plugin; reconstructed the ID generation from rk.XML.pluginmap()
-				rk.call.plugin(paste("rkward::", name, ".", name, sep=""))
+				plugin.ID <- auto.ids(paste(name, name, sep=""), prefix=ID.prefix("component"), chars=25)
+				rk.call.plugin(paste("rkward::", plugin.ID, sep=""))
 			} else {}
 		} else {}
 	} else {}

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.components.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.components.Rd	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.components.Rd	2011-09-30 21:05:49 UTC (rev 3871)
@@ -22,7 +22,7 @@
 cat(pasteXMLNode(test.components))
 }
 \seealso{
-  \code{\link[rkwarddev:rk.XML.pluginmap]{rk.XML.pluginmap}}
+  \code{\link[rkwarddev:rk.XML.pluginmap]{rk.XML.pluginmap}},
   \code{\link[rkwarddev:rk.XML.component]{rk.XML.component}}
 }
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.context.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.context.Rd	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.context.Rd	2011-09-30 21:05:49 UTC (rev 3871)
@@ -24,4 +24,9 @@
 test.context <- rk.XML.context(test.menu)
 cat(pasteXMLNode(test.context))
 }
+\seealso{
+  \code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}},
+  \code{\link[rkwarddev:rk.XML.entry]{rk.XML.entry}},
+  \code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
+}
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.entry.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.entry.Rd	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.entry.Rd	2011-09-30 21:05:49 UTC (rev 3871)
@@ -23,6 +23,9 @@
 cat(pasteXMLNode(test.entry))
 }
 \seealso{
-  \code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}}
+  \code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}},
+  \code{\link[rkwarddev:rk.XML.hierarchy]{rk.XML.hierarchy}},
+  \code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
+  \code{\link[rkwarddev:rk.XML.components]{rk.XML.components}}
 }
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.hierarchy.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.hierarchy.Rd	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.hierarchy.Rd	2011-09-30 21:05:49 UTC (rev 3871)
@@ -23,6 +23,9 @@
 cat(pasteXMLNode(test.hierarchy))
 }
 \seealso{
-  \code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}}
+  \code{\link[rkwarddev:rk.XML.menu]{rk.XML.menu}},
+  \code{\link[rkwarddev:rk.XML.entry]{rk.XML.entry}},
+  \code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
+  \code{\link[rkwarddev:rk.XML.components]{rk.XML.components}}
 }
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.menu.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.menu.Rd	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.menu.Rd	2011-09-30 21:05:49 UTC (rev 3871)
@@ -22,9 +22,9 @@
   A list of objects of class \code{XiMpLe.node}.
 }
 \description{
-  This function will create a menu node for entry sections.
-  Use same \code{id} values to place entries in the same
-  menu.
+  This function will create a menu node for hierarchy
+  sections. Use same \code{id} values to place entries in
+  the same menu.
 }
 \examples{
 test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
@@ -33,6 +33,9 @@
 cat(pasteXMLNode(test.menu))
 }
 \seealso{
-  \code{\link[rkwarddev:rk.XML.menus]{rk.XML.menus}}
+  \code{\link[rkwarddev:rk.XML.hierarchy]{rk.XML.hierarchy}},
+  \code{\link[rkwarddev:rk.XML.entry]{rk.XML.entry}},
+  \code{\link[rkwarddev:rk.XML.component]{rk.XML.component}},
+  \code{\link[rkwarddev:rk.XML.components]{rk.XML.components}}
 }
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.pluginmap.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.pluginmap.Rd	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.pluginmap.Rd	2011-09-30 21:05:49 UTC (rev 3871)
@@ -3,33 +3,66 @@
 \title{Write a pluginmap file for RKWard}
 \usage{
   rk.XML.pluginmap(name, about = NULL, components,
-  plugin.dir = "plugins", hierarchy = "analysis",
-  clean.name = TRUE)
+  hierarchy = "test", require = NULL, x11.context = NULL,
+  import.context = NULL, clean.name = TRUE, hints = FALSE)
 }
 \arguments{
   \item{name}{Character string, name of the plugin.}
 
-  \item{about}{A list with descriptive information on the
-  plugin,its authors and dependencies. See
+  \item{about}{Either an object of class \code{XiMpLe.node}
+  to be pasted as the \code{<about>} section, or a list
+  with descriptive information on the plugin,its authors
+  and dependencies. See
   \code{link[XiMpLe:rk.XML.about]{rk.XML.about}} for
   details! Skipped if \code{NULL}.}
 
-  \item{components}{A character vector with at least one
-  plugin component file name, ending with ".xml".}
+  \item{components}{Either an object of class
+  \code{XiMpLe.node} to be pasted as the
+  \code{<components>} section (see
+  \code{\link[rkwarddev:rk.XML.components]{rk.XML.components}}
+  for details). Or a character vector with at least one
+  plugin component file name, relative path from the
+  pluginmap file and ending with ".xml".}
 
-  \item{plugin.dir}{Character string, relative path to the
-  component XML and JS files.}
-
-  \item{hierarchy}{A character vector with instructions
+  \item{hierarchy}{Either an object of class
+  \code{XiMpLe.node} to be pasted as the \code{<hierarchy>}
+  section (see
+  \code{\link[rkwarddev:rk.XML.hierarchy]{rk.XML.hierarchy}}
+  for details). Or a character vector with instructions
   where to place the plugin in the menu hierarchy, one
   string for each included component. Valid values are
-  \code{"analysis"}, \code{"plots"} and \code{"data"}. To
-  place your dialogs somewhere else, edit the pluginmap
-  manually.}
+  \code{"file"}, \code{"edit"}, \code{"view"},
+  \code{"workspace"}, \code{"run"}, \code{"data"},
+  \code{"analysis"}, \code{"plots"},
+  \code{"distributions"}, \code{"windows"},
+  \code{"settings"} and \code{"help"}. Anything else will
+  place it in a "test" menu.}
 
+  \item{require}{Either a (list of) objects of class
+  \code{XiMpLe.node} to be pasted as a \code{<require>}
+  section (see
+  \code{\link[rkwarddev:rk.XML.require]{rk.XML.require}}
+  for details). Or a character vector with at least one
+  .pluginmap filename to be included in this one.}
+
+  \item{x11.context}{An object of class \code{XiMpLe.node}
+  to be pasted as a \code{<context id="x11">} section, see
+  \code{\link[rkwarddev:rk.XML.context]{rk.XML.context}}
+  for details.}
+
+  \item{import.context}{An object of class
+  \code{XiMpLe.node} to be pasted as the \code{<context
+  id="import">} section, see
+  \code{\link[rkwarddev:rk.XML.context]{rk.XML.context}}
+  for details.}
+
   \item{clean.name}{Logical, if \code{TRUE}, all
   non-alphanumeric characters except the underscore
   (\code{"_"}) will be removed from \code{name}.}
+
+  \item{hints}{Logical, if \code{TRUE} and you leave out
+  optional entries (like \code{about=NULL}), dummy sections
+  will be added as comments.}
 }
 \description{
   Write a pluginmap file for RKWard

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-30 13:35:58 UTC (rev 3870)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-30 21:05:49 UTC (rev 3871)
@@ -6,9 +6,9 @@
   dialog = NULL, wizard = NULL, logic = NULL, snippets =
   NULL, provides = c("logic", "dialog"), dial.require =
   c(), overwrite = FALSE, tests = TRUE, lazyLoad = TRUE,
-  JS.prep = NULL, JS.calc = NULL, JS.prnt = NULL, create =
-  c("pmap", "xml", "js", "rkh", "desc"), edit = FALSE, load
-  = FALSE, show = FALSE)
+  menu = "test", JS.prep = NULL, JS.calc = NULL, JS.prnt =
+  NULL, create = c("pmap", "xml", "js", "rkh", "desc"),
+  edit = FALSE, load = FALSE, show = FALSE)
 }
 \arguments{
   \item{name}{Character sting, name of the plugin package.}
@@ -63,6 +63,15 @@
   prepared for lazy loading or not. Should be left
   \code{TRUE}, unless you have very good reasons not to.}
 
+  \item{menu}{A character string with instructions where to
+  place the plugin in the menu hierarchy, Valid values are
+  \code{"file"}, \code{"edit"}, \code{"view"},
+  \code{"workspace"}, \code{"run"}, \code{"data"},
+  \code{"analysis"}, \code{"plots"},
+  \code{"distributions"}, \code{"windows"},
+  \code{"settings"} and \code{"help"}. Anything else will
+  place it in a "test" menu.}
+
   \item{JS.prep}{A character string with JavaScript code to
   be included in the \code{preprocess()} function. This
   string will be pasted as-is, see

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list