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

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Thu Sep 22 16:21:52 UTC 2011


Revision: 3818
          http://rkward.svn.sourceforge.net/rkward/?rev=3818&view=rev
Author:   m-eik
Date:     2011-09-22 16:21:52 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
rkwarddev: new function rk.XMLvarslot(), added some options and fixes to others

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/NAMESPACE
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.JS.doc.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.tabbook.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.vars.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.JS.doc.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.vars.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd

Added Paths:
-----------
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.varslot.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.varslot.Rd

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-22 16:21:52 UTC (rev 3818)
@@ -2,7 +2,13 @@
 
 ## 0.01-4 (2011-09-21)
   - fixed wrong doc link in rk.plugin.skeleton()
+  - fixed attribute typo in rk.XML.vars()
+  - fixed issue with auto-generated IDs (now using "_" instead of ".")
   - added wizard code options to rk.XML.plugin() and rk.plugin.skeleton()
+  - added function rk.XML.varslot()
+  - added possibility to add custom XML nodes to the varslot in rk.XML.vars()
+  - added possibility to paste ready-to-use JavaScript code directly to the preprocess(),
+    calculate() and printout() functions, respectively
 
 ## 0.01-3 (2011-09-16)
   - added rk.XML.spinbox() and missing options to rk.XML.browser() and rk.XML.saveobj()

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-22 16:21:52 UTC (rev 3818)
@@ -16,7 +16,7 @@
 Authors at R: c(person(given="Meik", family="Michalke",
     email="meik.michalke at hhu.de", role=c("aut", "cre")))
 Version: 0.01-4
-Date: 2011-09-21
+Date: 2011-09-22
 Collate:
     'rk-internal.R'
     'rk.JS.array.R'
@@ -44,4 +44,5 @@
     'rk.XML.stretch.R'
     'rk.XML.tabbook.R'
     'rk.XML.text.R'
+    'rk.XML.varslot.R'
     'rk.XML.vars.R'

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/NAMESPACE
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/NAMESPACE	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/NAMESPACE	2011-09-22 16:21:52 UTC (rev 3818)
@@ -22,3 +22,4 @@
 export(rk.XML.tabbook)
 export(rk.XML.text)
 export(rk.XML.vars)
+export(rk.XML.varslot)

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R	2011-09-22 16:21:52 UTC (rev 3818)
@@ -88,7 +88,7 @@
 camelCode <- function(words){
 
 	words <- as.vector(unlist(sapply(words, function(cur.word){
-			unlist(strsplit(cur.word, split="\\."))
+			unlist(strsplit(cur.word, split="[._]"))
 		})))
 
 	new.words <- sapply(words[-1], function(cur.word){
@@ -117,7 +117,7 @@
 } ## end function get.JS.vars()
 
 ## function ID.prefix()
-ID.prefix <- function(initial, abbr=TRUE, length=3, dot=TRUE){
+ID.prefix <- function(initial, abbr=TRUE, length=3, dot=FALSE){
 	if(isTRUE(abbr)){
 		prfx <- abbreviate(initial, minlength=length, strict=TRUE)
 	} else {
@@ -126,7 +126,9 @@
 	}
 	if(isTRUE(dot)){
 		prfx <- paste(prfx, ".", sep="")
-	} else {}
+	} else {
+		prfx <- paste(prfx, "_", sep="")
+	}
 	return(prfx)
 } ## end function ID.prefix()
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.JS.doc.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.JS.doc.R	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.JS.doc.R	2011-09-22 16:21:52 UTC (rev 3818)
@@ -1,30 +1,45 @@
 #' Create JavaScript outline from RKWard plugin XML
+#' 
+#' @note The JavaScript
 #'
 #' @param require A character vector with names of R packages that the dialog depends on.
 #' @param variables A character string to be included to read in all needed variables from the dialog.
 #'		Refer to \code{\link{rk.JS.scan}} for a function to create this from an existing plugin XML file. 
 #' @param results.header A character string to headline the printed results.
+#' @param preprocess A character string to be included in the \code{preprocess()} function. This string will be
+#'		pasted as-is, after \code{require} has been evaluated.
+#' @param calculate A character string to be included in the \code{calculate()} function. This string will be
+#'		pasted as-is, after \code{variables} has been evaluated.
+#' @param printout A character string to be included in the \code{printout()} function. This string will be
+#'		pasted as-is, after \code{results.header} has been evaluated.
 #' @param indent.by A character string defining how indentation should be done.
 #' @return A character string.
 #' @export
 
-rk.JS.doc <- function(require=c(), variables=NULL, results.header=NULL, indent.by="\t"){
+rk.JS.doc <- function(require=c(), variables=NULL, results.header=NULL,
+	preprocess=NULL, calculate=NULL, printout=NULL, indent.by="\t"){
 
 	js.require <- unlist(sapply(require, function(this.req){
 			paste(indent(2, by=indent.by), "echo(\"require(", this.req, ")\\n\");", sep="")
 		}))
-	js.preprocess <- paste("function preprocess(){\n", indent(2, by=indent.by), "// add requirements etc. here.\n",
-		paste(js.require, collapse="\n"), "\n}", sep="")
+	js.preprocess <- paste("function preprocess(){\n",
+		indent(2, by=indent.by), "// add requirements etc. here.\n",
+		paste(js.require, collapse="\n"), "\n",
+		ifelse(is.null(preprocess), "", preprocess),
+		"\n}", sep="")
 
 	js.calculate <- paste("function calculate(){\n",
 			indent(2, by=indent.by), "// read in variables from dialog\n",
 			paste(variables, collapse=""), "\n",
-			indent(2, by=indent.by), "// create the R code to be evaluated here\n}", sep="")
+			indent(2, by=indent.by), "// put the R code to be evaluated here.\n",
+			ifelse(is.null(calculate), "", calculate),
+			"\n}", sep="")
 		
 	js.printout <- paste("function printout(){\n",
 				indent(2, by=indent.by), "// printout the results\n",
 				indent(2, by=indent.by), "echo(\"rk.header(\\\"", results.header,"\\\", level=2)\\n\");\n",
-				indent(2, by=indent.by), "echo(\"rk.print(\\\"\\\")\\n\");\n}", sep="")
+				ifelse(is.null(printout), paste(indent(2, by=indent.by), "echo(\"rk.print(\\\"\\\")\\n\");", sep=""), printout),
+				"\n}", sep="")
 
 	JS.doc <- paste(js.preprocess, js.calculate, js.printout, sep="\n\n")
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.tabbook.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.tabbook.R	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.tabbook.R	2011-09-22 16:21:52 UTC (rev 3818)
@@ -35,7 +35,7 @@
 	}
 
 	if(identical(id.name, "auto")){
-		tab.ids <- auto.ids(tab.labels, prefix=ID.prefix("tabbook"))
+		tab.ids <- auto.ids(tab.labels, prefix=ID.prefix("tabbook", length=3))
 	} else {}
 	tabs <- sapply(1:num.tabs, function(this.num){
 			this.tab <- tab.labels[[this.num]]
@@ -58,7 +58,7 @@
 		})
 
 	if(identical(id.name, "auto")){
-		tb.id <- auto.ids(label, prefix="tbk.")
+		tb.id <- auto.ids(label, prefix=ID.prefix("tabbook", length=4))
 	} else if(!is.null(id.name)){
 		tb.id <- id.name[[1]]
 	} else {}

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.vars.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.vars.R	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.vars.R	2011-09-22 16:21:52 UTC (rev 3818)
@@ -23,6 +23,7 @@
 #'		of a variable!
 #' @param horiz Logical. If \code{TRUE}, the varslot will be placed next to the selector,
 #'		if \code{FALSE} below it.
+#' @param add.nodes A list of objects of class \code{XiMpLe.node} to be placed after the varslot.
 #' @param id.name Character vector, unique IDs for the frame (first entry), the varselector (second entry)
 #'		and varslot (third entry).
 #'		If \code{"auto"}, IDs will be generated automatically from \code{label} and \code{slot.text}.
@@ -32,67 +33,50 @@
 #' test.vars <- rk.XML.vars("Select some vars", "Vars go here")
 #' cat(pasteXMLNode(test.vars, shine=1))
 
-rk.XML.vars <- function(label, slot.text=NULL, required=FALSE, multi=FALSE, min=1, any=1, max=0,
-	dim=0, min.len=0, max.len=NULL, classes=NULL, types=NULL, horiz=TRUE, id.name="auto"){
+rk.XML.vars <- function(label, slot.text, required=FALSE, multi=FALSE, min=1, any=1, max=0,
+	dim=0, min.len=0, max.len=NULL, classes=NULL, types=NULL, horiz=TRUE, add.nodes=NULL, id.name="auto"){
 	if(identical(id.name, "auto")){
+		## if this ID generation get's changed, change it in rk.XML.varslot(), too!
 		var.sel.attr <- list(id=auto.ids(label, prefix=ID.prefix("varselector", length=3)))
-		var.slot.attr <- list(id=auto.ids(label, prefix=ID.prefix("varslot", length=4)))
+		var.slot.id <- auto.ids(label, prefix=ID.prefix("varslot", length=4))
 	} else if(!is.null(id.name)){
 		var.sel.attr <- list(id=id.name[[2]])
-		var.slot.attr <- list(id=id.name[[3]])
+		var.slot.id <- id.name[[3]]
 	} else {}
 	
 	v.selector <- new("XiMpLe.node",
 		name="varselector",
 		attributes=var.sel.attr)
 
-	if(!is.null(slot.text)){
-		var.slot.attr[["label"]] <- slot.text
-	} else {}
+	v.slot <- rk.XML.varslot(
+		label=slot.text,
+		source=var.sel.attr[["id"]],
+		required=required,
+		multi=multi,
+		min=min,
+		any=any,
+		max=max,
+		dim=dim,
+		min.len=min.len,
+		max.len=max.len,
+		classes=classes,
+		types=types,
+		id.name=var.slot.id)
 
-	var.slot.attr[["sources"]] <- var.sel.attr[["id"]]
-	if(!is.null(classes)){
-		var.slot.attr[["classes"]] <- paste(classes, collapse=" ")
+	# do we need to add extra nodes to the varslot?
+	slot.content <- list(v.slot)
+	if(!is.null(add.nodes)){
+		for (this.node in add.nodes) {
+			slot.content[[length(slot.content)+1]] <- this.node
+		}
 	} else {}
-	if(!is.null(types)){
-		valid.types <- types[types %in% c("unknown", "number", "string", "factor", "invalid")]
-		var.slot.attr[["types"]] <- paste(valid.types, collapse=" ")
-	} else {}
-	if(isTRUE(required)){
-		var.slot.attr[["required"]] <- "true"
-	} else {}
-	if(isTRUE(multi)){
-		var.slot.attr[["multi"]] <- "true"
-		if(min > 1){
-			var.slot.attr[["min_vars"]] <- min
-		} else {}
-		if(any > 1){
-			var.slot.attr[["min_vars_if_any"]] <- any
-		} else {}
-		if(max > 0){
-			var.slot.attr[["max_vars"]] <- max
-		} else {}
-	} else {}
 
-	if(dim > 0){
-		var.slot.attr[["num_dimensions"]] <- dim
-	} else {}
-	if(min.len > 0){
-		var.slot.attr[["min_length"]] <- min.len
-	} else {}
-	if(!is.null(max.len)){
-		var.slot.attr[["max_length"]] <- max.len
-	} else {}
-
-	v.slot <- new("XiMpLe.node",
-		name="varslot",
-		attributes=var.slot.attr)
-
 	if(isTRUE(horiz)){
-		aligned.chld <- rk.XML.row(list(rk.XML.col(v.selector), rk.XML.col(v.slot)))
+		aligned.chld <- rk.XML.row(list(rk.XML.col(v.selector), rk.XML.col(slot.content)))
 	} else {
-		aligned.chld <- list(v.selector, v.slot)
+		aligned.chld <- list(v.selector, unlist(slot.content))
 	}
+
 	vars.frame <- rk.XML.frame(
 		children=child.list(aligned.chld),
 		label=label,

Added: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.varslot.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.varslot.R	                        (rev 0)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.varslot.R	2011-09-22 16:21:52 UTC (rev 3818)
@@ -0,0 +1,92 @@
+#' Create a XML node "varslot" for RKWard plugins
+#'
+#' @param label Character string, a text label for the varslot.
+#' @param source Character string with either the \code{id} name of the \code{varselector} to select variables
+#'		from, or the label value used for that \code{varselector} (if \code{src.label=TRUE}).
+#' @param required Logical, whether the selection of variables is mandatory or not.
+#' @param multi Logical, whether the varslot holds only one or several objects.
+#' @param min If \code{multi=TRUE} defines how many objects must be selected.
+#' @param any If \code{multi=TRUE} defines how many objects must be selected at least if any
+#'		are selected at all.
+#' @param max If \code{multi=TRUE} defines how many objects can be selected in total
+#'		(0 means any number).
+#' @param dim The number of dimensions, an object needs to have. If \code{dim=0} any number
+#'		of dimensions is acceptable.
+#' @param min.len The minimum length, an object needs to have.
+#' @param max.len The maximum length, an object needs to have. If \code{NULL}, defaults to the largest
+#'		integer number representable on the system.
+#' @param classes An optional character vector, defining class names to which the selection must be limited.
+#' @param types If you specify one or more variables types here, the varslot will only accept objects of those
+#'		types. Valid types are "unknown", "number", "string", "factor", "invalid". Optional, use with great care,
+#'		the user should not be prevented from making valid choices, and rkward does not always know the type
+#'		of a variable!
+#' @param src.label Logical, determines how to treat \code{source}. If \code{TRUE}, the value of \code{source}
+#'		is assumed to be the label rather than the ID of the corresponding \code{varselector}. The ID is then generated
+#'		automatically, using the same heuristics as \code{\link[rkwarddev:rk.XML.vars]{rk.XML.vars}}. This
+#'		ensures the IDs are identical without needing to know them beforehand.
+#' @param id.name Character vector, unique ID for the varslot.
+#'		If \code{"auto"}, the ID will be generated automatically from \code{label}.
+#' @return An object of class \code{XiMpLe.node}.
+#' @export
+#' @examples
+#' \dontrun{
+#' test.varslot <- rk.XML.varslot("Vars go here", sources=c("selector.id"))
+#' cat(pasteXMLNode(test.varslot, shine=1))
+#' }
+
+rk.XML.varslot <- function(label, source, required=FALSE, multi=FALSE, min=1, any=1, max=0,
+	dim=0, min.len=0, max.len=NULL, classes=NULL, types=NULL, src.label=FALSE, id.name="auto"){
+	if(identical(id.name, "auto")){
+		var.slot.attr <- list(id=auto.ids(label, prefix=ID.prefix("varslot", length=4)))
+	} else if(!is.null(id.name)){
+		var.slot.attr <- list(id=id.name)
+	} else {}
+	
+	var.slot.attr[["label"]] <- label
+
+	if(isTRUE(src.label)){
+		# grab this from rk.XML.vars()
+		var.slot.attr[["source"]] <- auto.ids(source, prefix=ID.prefix("varselector", length=3))
+	} else {
+		var.slot.attr[["source"]] <- source
+	}
+
+	if(!is.null(classes)){
+		var.slot.attr[["classes"]] <- paste(classes, collapse=" ")
+	} else {}
+	if(!is.null(types)){
+		valid.types <- types[types %in% c("unknown", "number", "string", "factor", "invalid")]
+		var.slot.attr[["types"]] <- paste(valid.types, collapse=" ")
+	} else {}
+	if(isTRUE(required)){
+		var.slot.attr[["required"]] <- "true"
+	} else {}
+	if(isTRUE(multi)){
+		var.slot.attr[["multi"]] <- "true"
+		if(min > 1){
+			var.slot.attr[["min_vars"]] <- min
+		} else {}
+		if(any > 1){
+			var.slot.attr[["min_vars_if_any"]] <- any
+		} else {}
+		if(max > 0){
+			var.slot.attr[["max_vars"]] <- max
+		} else {}
+	} else {}
+
+	if(dim > 0){
+		var.slot.attr[["num_dimensions"]] <- dim
+	} else {}
+	if(min.len > 0){
+		var.slot.attr[["min_length"]] <- min.len
+	} else {}
+	if(!is.null(max.len)){
+		var.slot.attr[["max_length"]] <- max.len
+	} else {}
+
+	v.slot <- new("XiMpLe.node",
+		name="varslot",
+		attributes=var.slot.attr)
+
+	return(v.slot)
+}

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-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-22 16:21:52 UTC (rev 3818)
@@ -14,6 +14,14 @@
 #'		Defaults to \code{FALSE}.
 #' @param tests Logical, whether directories and files for plugin tests should be created.
 #'		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 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
+#'		pasted as-is, see \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.
+#' @param JS.prnt A character string with JavaScript code to be included in the \code{printout()} function. This string will be
+#'		pasted as-is, see \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.
 #' @export
 #' @examples
 #' \dontrun{
@@ -76,7 +84,9 @@
 #'   dialog=test.tabbook, overwrite=TRUE)
 #' }
 
-rk.plugin.skeleton <- function(name, about, path=tempdir(), dialog=list(), wiz.dialog=list(), dial.require=c(), overwrite=FALSE, wizard=FALSE, tests=TRUE, lazyLoad=TRUE){
+rk.plugin.skeleton <- function(name, about, path=tempdir(), dialog=list(), wiz.dialog=list(),
+	dial.require=c(), overwrite=FALSE, wizard=FALSE, tests=TRUE, lazyLoad=TRUE,
+	JS.prep=NULL, JS.calc=NULL, JS.prnt=NULL){
 	# to besure, remove all non-character symbols from name
 	name.orig <- name
 	name <- gsub("[[:space:]]*[^[:alnum:]]*", "", name)
@@ -153,7 +163,10 @@
 		JS.code <- rk.JS.doc(
 			require=dial.require,
 			variables=rk.JS.scan(XML.plugin),
-			results.header=paste(name.orig, " results", sep=""))
+			results.header=paste(name.orig, " results", sep=""),
+			preprocess=JS.prep,
+			calculate=JS.calc,
+			printout=JS.prnt)
 		cat(JS.code, file=plugin.js)
 	} else {}
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-22 16:21:52 UTC (rev 3818)
@@ -4,7 +4,7 @@
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
 #' Version: \tab 0.01-4\cr
-#' Date: \tab 2011-09-21\cr
+#' Date: \tab 2011-09-22\cr
 #' Depends: \tab R (>= 2.9.0), XiMpLe\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.JS.doc.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.JS.doc.Rd	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.JS.doc.Rd	2011-09-22 16:21:52 UTC (rev 3818)
@@ -3,7 +3,8 @@
 \title{Create JavaScript outline from RKWard plugin XML}
 \usage{
   rk.JS.doc(require = c(), variables = NULL, results.header
-  = NULL, indent.by = "\t")
+  = NULL, preprocess = NULL, calculate = NULL, printout =
+  NULL, indent.by = "\t")
 }
 \arguments{
   \item{require}{A character vector with names of R
@@ -17,6 +18,18 @@
   \item{results.header}{A character string to headline the
   printed results.}
 
+  \item{preprocess}{A character string to be included in
+  the \code{preprocess()} function. This string will be
+  pasted as-is, after \code{require} has been evaluated.}
+
+  \item{calculate}{A character string to be included in the
+  \code{calculate()} function. This string will be pasted
+  as-is, after \code{variables} has been evaluated.}
+
+  \item{printout}{A character string to be included in the
+  \code{printout()} function. This string will be pasted
+  as-is, after \code{results.header} has been evaluated.}
+
   \item{indent.by}{A character string defining how
   indentation should be done.}
 }
@@ -26,4 +39,7 @@
 \description{
   Create JavaScript outline from RKWard plugin XML
 }
+\note{
+  The JavaScript
+}
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.vars.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.vars.Rd	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.vars.Rd	2011-09-22 16:21:52 UTC (rev 3818)
@@ -2,10 +2,10 @@
 \alias{rk.XML.vars}
 \title{Create a variable selector for RKWard plugins}
 \usage{
-  rk.XML.vars(label, slot.text = NULL, required = FALSE,
-  multi = FALSE, min = 1, any = 1, max = 0, dim = 0,
-  min.len = 0, max.len = NULL, classes = NULL, types =
-  NULL, horiz = TRUE, id.name = "auto")
+  rk.XML.vars(label, slot.text, required = FALSE, multi =
+  FALSE, min = 1, any = 1, max = 0, dim = 0, min.len = 0,
+  max.len = NULL, classes = NULL, types = NULL, horiz =
+  TRUE, add.nodes = NULL, id.name = "auto")
 }
 \arguments{
   \item{label}{Character string, a text label for the whole
@@ -53,6 +53,9 @@
   \item{horiz}{Logical. If \code{TRUE}, the varslot will be
   placed next to the selector, if \code{FALSE} below it.}
 
+  \item{add.nodes}{A list of objects of class
+  \code{XiMpLe.node} to be placed after the varslot.}
+
   \item{id.name}{Character vector, unique IDs for the frame
   (first entry), the varselector (second entry) and varslot
   (third entry). If \code{"auto"}, IDs will be generated

Added: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.varslot.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.varslot.Rd	                        (rev 0)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.varslot.Rd	2011-09-22 16:21:52 UTC (rev 3818)
@@ -0,0 +1,80 @@
+\name{rk.XML.varslot}
+\alias{rk.XML.varslot}
+\title{Create a XML node "varslot" for RKWard plugins}
+\usage{
+  rk.XML.varslot(label, source, required = FALSE, multi =
+  FALSE, min = 1, any = 1, max = 0, dim = 0, min.len = 0,
+  max.len = NULL, classes = NULL, types = NULL, src.label =
+  FALSE, id.name = "auto")
+}
+\arguments{
+  \item{label}{Character string, a text label for the
+  varslot.}
+
+  \item{source}{Character string with either the \code{id}
+  name of the \code{varselector} to select variables from,
+  or the label value used for that \code{varselector} (if
+  \code{src.label=TRUE}).}
+
+  \item{required}{Logical, whether the selection of
+  variables is mandatory or not.}
+
+  \item{multi}{Logical, whether the varslot holds only one
+  or several objects.}
+
+  \item{min}{If \code{multi=TRUE} defines how many objects
+  must be selected.}
+
+  \item{any}{If \code{multi=TRUE} defines how many objects
+  must be selected at least if any are selected at all.}
+
+  \item{max}{If \code{multi=TRUE} defines how many objects
+  can be selected in total (0 means any number).}
+
+  \item{dim}{The number of dimensions, an object needs to
+  have. If \code{dim=0} any number of dimensions is
+  acceptable.}
+
+  \item{min.len}{The minimum length, an object needs to
+  have.}
+
+  \item{max.len}{The maximum length, an object needs to
+  have. If \code{NULL}, defaults to the largest integer
+  number representable on the system.}
+
+  \item{classes}{An optional character vector, defining
+  class names to which the selection must be limited.}
+
+  \item{types}{If you specify one or more variables types
+  here, the varslot will only accept objects of those
+  types. Valid types are "unknown", "number", "string",
+  "factor", "invalid". Optional, use with great care, the
+  user should not be prevented from making valid choices,
+  and rkward does not always know the type of a variable!}
+
+  \item{src.label}{Logical, determines how to treat
+  \code{source}. If \code{TRUE}, the value of \code{source}
+  is assumed to be the label rather than the ID of the
+  corresponding \code{varselector}. The ID is then
+  generated automatically, using the same heuristics as
+  \code{\link[rkwarddev:rk.XML.vars]{rk.XML.vars}}. This
+  ensures the IDs are identical without needing to know
+  them beforehand.}
+
+  \item{id.name}{Character vector, unique ID for the
+  varslot. If \code{"auto"}, the ID will be generated
+  automatically from \code{label}.}
+}
+\value{
+  An object of class \code{XiMpLe.node}.
+}
+\description{
+  Create a XML node "varslot" for RKWard plugins
+}
+\examples{
+\dontrun{
+test.varslot <- rk.XML.varslot("Vars go here", sources=c("selector.id"))
+cat(pasteXMLNode(test.varslot, shine=1))
+}
+}
+

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-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-22 16:21:52 UTC (rev 3818)
@@ -5,7 +5,7 @@
   rk.plugin.skeleton(name, about, path = tempdir(), dialog
   = list(), wiz.dialog = list(), dial.require = c(),
   overwrite = FALSE, wizard = FALSE, tests = TRUE, lazyLoad
-  = TRUE)
+  = TRUE, JS.prep = NULL, JS.calc = NULL, JS.prnt = NULL)
 }
 \arguments{
   \item{name}{Character sting, name of the plugin package.}
@@ -39,6 +39,25 @@
 
   \item{tests}{Logical, whether directories and files for
   plugin tests should be created. Defaults to \code{TRUE}.}
+
+  \item{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.}
+
+  \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
+  \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.}
+
+  \item{JS.calc}{A character string with JavaScript code to
+  be included in the \code{calculate()} function. This
+  string will be pasted as-is, see
+  \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.}
+
+  \item{JS.prnt}{A character string with JavaScript code to
+  be included in the \code{printout()} function. This
+  string will be pasted as-is, see
+  \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.}
 }
 \description{
   Create skeleton for RKWard plugins

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-22 10:11:12 UTC (rev 3817)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-22 16:21:52 UTC (rev 3818)
@@ -9,7 +9,7 @@
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
   Package\cr Version: \tab 0.01-4\cr Date: \tab
-  2011-09-21\cr Depends: \tab R (>= 2.9.0), XiMpLe\cr
+  2011-09-22\cr Depends: \tab R (>= 2.9.0), XiMpLe\cr
   Enhances: \tab rkward\cr Encoding: \tab UTF-8\cr License:
   \tab GPL (>= 3)\cr LazyLoad: \tab yes\cr URL: \tab
   http://rkward.sourceforge.net\cr }

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