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

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Fri Sep 16 15:28:52 UTC 2011


Revision: 3789
          http://rkward.svn.sourceforge.net/rkward/?rev=3789&view=rev
Author:   m-eik
Date:     2011-09-16 15:28:52 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
rkwarddev: added spinbox function, new options and wizard to plugin skeleton

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.XML.browser.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.input.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.plugin.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.saveobj.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/inst/CITATION
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.browser.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.input.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.plugin.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.saveobj.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-16 15:28:52 UTC (rev 3789)
@@ -1,5 +1,10 @@
 ChangeLog for package rkwarddev
 
+## 0.01-3 (2011-09-16)
+  - added rk.XML.spinbox() and missing options to rk.XML.browser() and rk.XML.saveobj()
+  - corrected browser default type in rk.XML.browser()
+  - added wizard option to rk.plugin.skeleton()
+
 ## 0.01-2 (2011-09-15)
   - reworked rk.XML.about() to use person class objects for authors, and need less info to
     produce usable output

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-16 15:28:52 UTC (rev 3789)
@@ -15,8 +15,8 @@
 URL: http://rkward.sourceforge.net
 Authors at R: c(person(given="Meik", family="Michalke",
     email="meik.michalke at hhu.de", role=c("aut", "cre")))
-Version: 0.01-2
-Date: 2011-09-15
+Version: 0.01-3
+Date: 2011-09-16
 Collate:
     'rk-internal.R'
     'rk.JS.array.R'
@@ -28,7 +28,6 @@
     'rk.testsuite.doc.R'
     'rkwarddev-desc-internal.R'
     'rkwarddev-package.R'
-    'rkwardplugdev-package.R'
     'rk.XML.about.R'
     'rk.XML.browser.R'
     'rk.XML.cbox.R'
@@ -41,6 +40,7 @@
     'rk.XML.radio.R'
     'rk.XML.row.R'
     'rk.XML.saveobj.R'
+    'rk.XML.spinbox.R'
     'rk.XML.stretch.R'
     'rk.XML.tabbook.R'
     'rk.XML.text.R'

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/NAMESPACE
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/NAMESPACE	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/NAMESPACE	2011-09-16 15:28:52 UTC (rev 3789)
@@ -17,6 +17,7 @@
 export(rk.XML.radio)
 export(rk.XML.row)
 export(rk.XML.saveobj)
+export(rk.XML.spinbox)
 export(rk.XML.stretch)
 export(rk.XML.tabbook)
 export(rk.XML.text)

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.browser.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.browser.R	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.browser.R	2011-09-16 15:28:52 UTC (rev 3789)
@@ -1,7 +1,12 @@
 #' Create XML node "browser" for RKWard plugins
 #'
 #' @param label Character string, a text label for this plugin element.
-#' @param dir Logical, if \code{TRUE} type of object browser defaults to "dir", otherwise "file".
+#' @param type Character string, valid values are "dir", "file" and "savefile" (i.e., an non-existing file).
+#' @param initial Character string, if not \code{NULL} will be used as the initial value of the browser.
+#' @param urls Logical, whether non-local URLs are permitted or not.
+#' @param filter Character vector, file type filter, e.g. \code{filter=c("*.txt", "*.csv")} for .txt and .csv files.
+#'		Try not to induce limits unless absolutely needed, though.
+#' @param required Logical, whether an entry is mandatory or not.
 #' @param id.name Character string, a unique ID for this plugin element.
 #'		If \code{"auto"} and a label was provided, an ID will be generated automatically from the label.
 #' @return An object of class \code{XiMpLe.node}.
@@ -11,13 +16,13 @@
 #' cat(pasteXMLNode(test.browser, shine=1))
 
 
-rk.XML.browser <- function(label, dir=TRUE, id.name="auto"){
+rk.XML.browser <- function(label, type="file", initial=NULL, urls=FALSE, filter=NULL, required=FALSE, id.name="auto"){
 	attr.list <- list(label=label)
 
-	if(isTRUE(dir)){
-		attr.list[["type"]] <- "dir"
+	if(length(type) == 1 & type %in% c("dir", "file", "savefile")){
+		attr.list[["type"]] <- type
 	} else {
-		attr.list[["type"]] <- "file"
+		stop(simpleError(paste("Unknown browser type: ", type, sep="")))
 	}
 
 	if(identical(id.name, "auto")){
@@ -25,6 +30,18 @@
 	} else if(!is.null(id.name)){
 		attr.list[["id"]] <- id.name
 	} else {}
+	if(!is.null(initial)){
+		attr.list[["initial"]] <- initial
+	} else {}
+	if(isTRUE(urls)){
+		attr.list[["allow_urls"]] <- "true"
+	} else {}
+	if(!is.null(filter)){
+		attr.list[["filter"]] <- paste(filter, collapse=" ")
+	} else {}
+	if(isTRUE(required)){
+		attr.list[["required"]] <- "true"
+	} else {}
 
 	node <- new("XiMpLe.node",
 			name="browser",

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.input.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.input.R	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.input.R	2011-09-16 15:28:52 UTC (rev 3789)
@@ -1,7 +1,7 @@
 #' Create XML node "input" for RKWard plugins
 #'
 #' @param label Character string, a text label for this plugin element.
-#' @param initial Character string, if not \code{NULL} will be used as thi initial value of the input field.
+#' @param initial Character string, if not \code{NULL} will be used as the initial value of the input field.
 #' @param size One value of either "small", "medium" or "large".
 #' @param required Logical, whether an entry is mandatory or not.
 #' @param id.name Character string, a unique ID for this plugin element.

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.plugin.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.plugin.R	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.plugin.R	2011-09-16 15:28:52 UTC (rev 3789)
@@ -23,7 +23,7 @@
 #'   "Second Tab"), children=list(test.checkboxes, test.dropdown))
 #' # make a plugin with that tabbook
 #' test.plugin <- rk.XML.plugin("My test", label="Check this out", children=test.tabbook)
-#' cat(pasteXMLNode(test.plugin, shine=1))
+#' cat(pasteXMLTree(test.plugin, shine=1))
 
 rk.XML.plugin <- function(name, label, children=list(), help=TRUE, logic=TRUE, provides=c("dialog"), pluginmap=NULL){
 	name.orig <- name
@@ -79,13 +79,19 @@
 
 	if("wizard" %in% provides){
 		## TODO: wizard code
+		# create a first page for the wizard section
+		plugin.wizard.page <- new("XiMpLe.node",
+				name="page",
+				attributes=list(label=label),
+				value="")
+		if(length(children) > 0){
+			plugin.wizard.page at children <- child.list(children)
+		} else {}
 		plugin.wizard <- new("XiMpLe.node",
 				name="wizard",
 				attributes=list(label=label),
+				children=child.list(plugin.wizard.page),
 				value="")
-		if(length(children) > 0){
-			plugin.wizard at children <- child.list(children)
-		} else {}
 		all.children[[length(all.children)+1]]	<- plugin.wizard
 	}
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.saveobj.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.saveobj.R	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.saveobj.R	2011-09-16 15:28:52 UTC (rev 3789)
@@ -5,6 +5,7 @@
 #' @param checkable Logical, if \code{TRUE} the option can be switched on and off.
 #' @param intitial Character string, the default name for the object should be saved to.
 #'		If \code{"auto"} and a label was provided, an name will be generated automatically from the label.
+#' @param required Logical, whether an entry is mandatory or not.
 #' @param id.name Character string, a unique ID for this plugin element.
 #'		If \code{"auto"} and a label was provided, an ID will be generated automatically from the label.
 #' @return An object of class \code{XiMpLe.node}.
@@ -13,7 +14,7 @@
 #' test.saveobj <- rk.XML.saveobj("Save the results")
 #' cat(pasteXMLNode(test.saveobj, shine=1))
 
-rk.XML.saveobj <- function(label, chk=FALSE, checkable=TRUE, initial="auto", id.name="auto"){
+rk.XML.saveobj <- function(label, chk=FALSE, checkable=TRUE, initial="auto", required=FALSE, id.name="auto"){
 	attr.list <- list(label=label)
 
 	if(isTRUE(checkable)){
@@ -30,6 +31,9 @@
 	} else if(!is.null(id.name)){
 		attr.list[["initial"]] <- initial
 	} else {}
+	if(isTRUE(required)){
+		attr.list[["required"]] <- "true"
+	} else {}
 
 
 	if(identical(id.name, "auto")){

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-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-16 15:28:52 UTC (rev 3789)
@@ -9,6 +9,8 @@
 #'		created plugin XML file as the dialog.
 #' @param dial.require A character vector with names of R packages that the dialog requires.
 #' @param overwrite Logical, whether existing files should be replaced. Defaults to \code{FALSE}.
+#' @param wizard Logical, whether a \code{<wizard>} section should be added to the \code{<dialog>} section.
+#'		Defaults to \code{FALSE}.
 #' @param tests Logical, whether directories and files for plugin tests should be created.
 #'		Defaults to \code{TRUE}.
 #' @export
@@ -73,7 +75,7 @@
 #'   dialog=test.tabbook, overwrite=TRUE)
 #' }
 
-rk.plugin.skeleton <- function(name, about, path=tempdir(), dialog=list(), dial.require=c(), overwrite=FALSE, tests=TRUE, lazyLoad=TRUE){
+rk.plugin.skeleton <- function(name, about, path=tempdir(), dialog=list(), dial.require=c(), overwrite=FALSE, wizard=FALSE, tests=TRUE, lazyLoad=TRUE){
 	# to besure, remove all non-character symbols from name
 	name.orig <- name
 	name <- gsub("[[:space:]]*[^[:alnum:]]*", "", name)
@@ -130,10 +132,16 @@
 
 	## create plugin.xml
 	if(isTRUE(checkCreateFiles(plugin.xml))){
+		if(isTRUE(wizard))
+			plugin.provides <- c("dialog","wizard")
+		else {
+			plugin.provides <- "dialog"
+		}
 		XML.plugin <- rk.XML.plugin(
 			name=name,
 			label=name.orig,
 			children=dialog,
+			provides=plugin.provides,
 			pluginmap=paste("../", name, ".pluginmap", sep=""))
 		cat(pasteXMLTree(XML.plugin, shine=1), file=plugin.xml)
 	} else {}

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-16 15:28:52 UTC (rev 3789)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.01-2\cr
-#' Date: \tab 2011-09-15\cr
+#' Version: \tab 0.01-3\cr
+#' Date: \tab 2011-09-16\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/inst/CITATION
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/inst/CITATION	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/inst/CITATION	2011-09-16 15:28:52 UTC (rev 3789)
@@ -3,12 +3,12 @@
 		author=c(person(given="Meik", family="Michalke", email="meik.michalke at hhu.de",
 			role=c("aut", "cre"))),
 		year="2011",
-		note="(Version 0.01-2)",
+		note="(Version 0.01-3)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2011). ",
-				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.01-2). ",
+				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.01-3). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.browser.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.browser.Rd	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.browser.Rd	2011-09-16 15:28:52 UTC (rev 3789)
@@ -2,15 +2,31 @@
 \alias{rk.XML.browser}
 \title{Create XML node "browser" for RKWard plugins}
 \usage{
-  rk.XML.browser(label, dir = TRUE, id.name = "auto")
+  rk.XML.browser(label, type = "file", initial = NULL, urls
+  = FALSE, filter = NULL, required = FALSE, id.name =
+  "auto")
 }
 \arguments{
   \item{label}{Character string, a text label for this
   plugin element.}
 
-  \item{dir}{Logical, if \code{TRUE} type of object browser
-  defaults to "dir", otherwise "file".}
+  \item{type}{Character string, valid values are "dir",
+  "file" and "savefile" (i.e., an non-existing file).}
 
+  \item{initial}{Character string, if not \code{NULL} will
+  be used as the initial value of the browser.}
+
+  \item{urls}{Logical, whether non-local URLs are permitted
+  or not.}
+
+  \item{filter}{Character vector, file type filter, e.g.
+  \code{filter=c("*.txt", "*.csv")} for .txt and .csv
+  files. Try not to induce limits unless absolutely needed,
+  though.}
+
+  \item{required}{Logical, whether an entry is mandatory or
+  not.}
+
   \item{id.name}{Character string, a unique ID for this
   plugin element. If \code{"auto"} and a label was
   provided, an ID will be generated automatically from the

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.input.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.input.Rd	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.input.Rd	2011-09-16 15:28:52 UTC (rev 3789)
@@ -10,7 +10,7 @@
   plugin element.}
 
   \item{initial}{Character string, if not \code{NULL} will
-  be used as thi initial value of the input field.}
+  be used as the initial value of the input field.}
 
   \item{size}{One value of either "small", "medium" or
   "large".}

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.plugin.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.plugin.Rd	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.plugin.Rd	2011-09-16 15:28:52 UTC (rev 3789)
@@ -51,6 +51,6 @@
 "Second Tab"), children=list(test.checkboxes, test.dropdown))
 # make a plugin with that tabbook
 test.plugin <- rk.XML.plugin("My test", label="Check this out", children=test.tabbook)
-cat(pasteXMLNode(test.plugin, shine=1))
+cat(pasteXMLTree(test.plugin, shine=1))
 }
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.saveobj.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.saveobj.Rd	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.saveobj.Rd	2011-09-16 15:28:52 UTC (rev 3789)
@@ -3,7 +3,7 @@
 \title{Create XML node "saveobject" for RKWard plugins}
 \usage{
   rk.XML.saveobj(label, chk = FALSE, checkable = TRUE,
-  initial = "auto", id.name = "auto")
+  initial = "auto", required = FALSE, id.name = "auto")
 }
 \arguments{
   \item{label}{Character string, a text label for this
@@ -21,6 +21,9 @@
   label was provided, an name will be generated
   automatically from the label.}
 
+  \item{required}{Logical, whether an entry is mandatory or
+  not.}
+
   \item{id.name}{Character string, a unique ID for this
   plugin element. If \code{"auto"} and a label was
   provided, an ID will be generated automatically from the

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-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-16 15:28:52 UTC (rev 3789)
@@ -3,8 +3,8 @@
 \title{Create skeleton for RKWard plugins}
 \usage{
   rk.plugin.skeleton(name, about, path = tempdir(), dialog
-  = list(), dial.require = c(), overwrite = FALSE, tests =
-  TRUE, lazyLoad = TRUE)
+  = list(), dial.require = c(), overwrite = FALSE, wizard =
+  FALSE, tests = TRUE, lazyLoad = TRUE)
 }
 \arguments{
   \item{name}{Character sting, name of the plugin package.}
@@ -28,6 +28,10 @@
   \item{overwrite}{Logical, whether existing files should
   be replaced. Defaults to \code{FALSE}.}
 
+  \item{wizard}{Logical, whether a \code{<wizard>} section
+  should be added to the \code{<dialog>} section. Defaults
+  to \code{FALSE}.}
+
   \item{tests}{Logical, whether directories and files for
   plugin tests should be created. Defaults to \code{TRUE}.}
 }

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-16 10:03:39 UTC (rev 3788)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-16 15:28:52 UTC (rev 3789)
@@ -8,8 +8,8 @@
 }
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
-  Package\cr Version: \tab 0.01-2\cr Date: \tab
-  2011-09-15\cr Depends: \tab R (>= 2.9.0), XiMpLe\cr
+  Package\cr Version: \tab 0.01-3\cr Date: \tab
+  2011-09-16\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