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

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Sun Sep 25 20:20:27 UTC 2011


Revision: 3834
          http://rkward.svn.sourceforge.net/rkward/?rev=3834&view=rev
Author:   m-eik
Date:     2011-09-25 20:20:26 +0000 (Sun, 25 Sep 2011)
Log Message:
-----------
rkwarddev: simplified rk.plugin.skeleton() and rk.XML.pluginmap() by making "about" entirely optional

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
    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.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-25 19:49:28 UTC (rev 3833)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-25 20:20:26 UTC (rev 3834)
@@ -6,6 +6,7 @@
   - added possibility to add custom XML code to the logic section with rk.XML.plugin()
     and rk.plugin.skeleton()
   - fixed id setting in rk.XML.browser()
+  - simplified rk.plugin.skeleton() and rk.XML.pluginmap() by making "about" entirely optional
 
 ## 0.01-4 (2011-09-22)
   - fixed wrong doc link and one wrong object name in rk.plugin.skeleton()

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-25 19:49:28 UTC (rev 3833)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.pluginmap.R	2011-09-25 20:20:26 UTC (rev 3834)
@@ -2,7 +2,7 @@
 #'
 #' @param name Character string, name of the plugin.
 #' @param about A list with descriptive information on the plugin,its authors and dependencies.
-#'		See \code{link[XiMpLe:rk.XML.about]{rk.XML.about}} for details!
+#'		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.
@@ -11,7 +11,7 @@
 #'		\code{"data"}. To place your dialogs somewhere else, edit the pluginmap manually.
 #' @export
 
-rk.XML.pluginmap <- function(name, about, components, plugin.dir="plugins", hierarchy="analysis"){
+rk.XML.pluginmap <- function(name, about=NULL, components, plugin.dir="plugins", hierarchy="analysis"){
 	# to besure, remove all non-character symbols from name
 	name.orig <- name
 	name <- gsub("[[:space:]]*[^[:alnum:]]*", "", name)
@@ -23,6 +23,7 @@
 	# - about
 	# - components
 	# - hierarchy
+	if(!is.null(about)){
 	about.XML <- rk.XML.about(
 		name=name.orig,
 		author=about[["author"]],
@@ -30,6 +31,11 @@
 		dependencies=about[["dependencies"]],
 		package=about[["package"]],
 		pluginmap=about[["pluginmap"]])
+	} else {
+		about.XML <- new("XiMpLe.node",
+		name="!--",
+		value="<about></about>")
+	}
 
 	components.XML <- new("XiMpLe.node",
 		name="components",

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-25 19:49:28 UTC (rev 3833)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-25 20:20:26 UTC (rev 3834)
@@ -4,6 +4,7 @@
 #' @param about A list with descriptive information on the plugin, its authors and dependencies.
 #'		At the very least you must specify \code{name} and \code{author}.
 #'		See \code{\link[rkwarddev:rk.XML.about]{rk.XML.about}} for details and a full list of elements!
+#'		If \code{NULL}, no \code{DESCRIPTION} file will be created either.
 #' @param path Character sting, path to the main directory where the skeleton should be created.
 #' @param dialog A list of objects of class XiMpLe.node. If provided, will be included in the
 #'		created plugin XML file as the dialog.
@@ -97,7 +98,7 @@
 #'   dialog=test.tabbook, overwrite=TRUE)
 #' }
 
-rk.plugin.skeleton <- function(name, about, path=tempdir(), dialog=list(), wiz.dialog=list(),
+rk.plugin.skeleton <- function(name, about=NULL, path=tempdir(), dialog=list(), wiz.dialog=list(),
 	dial.require=c(), overwrite=FALSE, wizard=FALSE, tests=TRUE, lazyLoad=TRUE, logic=NULL,
 	JS.prep=NULL, JS.calc=NULL, JS.prnt=NULL, create=c("pmap", "xml", "js", "rkh", "desc"), edit=FALSE){
 	# to besure, remove all non-character symbols from name
@@ -106,15 +107,23 @@
 	if(!identical(name.orig, name)){
 		message(paste("For filenames ", sQuote(name.orig), " was renamed to ", sQuote(name), ".", sep=""))
 	} else {}
-	# create an about.node, which probably has some default values
-	about.node <- rk.XML.about(
-		name=about[["name"]],
-		author=about[["author"]],
-		about=about[["about"]],
-		dependencies=about[["dependencies"]],
-		package=about[["package"]],
-		pluginmap=about[["pluginmap"]]
-	)
+
+	if(!is.null(about)){
+		# create an about.node, which probably has some default values
+		about.node <- rk.XML.about(
+			name=about[["name"]],
+			author=about[["author"]],
+			about=about[["about"]],
+			dependencies=about[["dependencies"]],
+			package=about[["package"]],
+			pluginmap=about[["pluginmap"]]
+		)
+	} else {
+		about.node <- NULL
+		# also stop creation of DESCRIPTION file
+		create <- create[!create %in% "desc"]
+	}
+
 	# define paths an file names
 	main.dir <- file.path(path, name)
 	description.file <- file.path(main.dir, "DESCRIPTION")
@@ -225,7 +234,7 @@
 		cat(testsuite.doc, file=testsuite.file)
 	} else {}
 
-	# create DESCRIPTION file
+	## create DESCRIPTION file
 	if("desc" %in% create & isTRUE(checkCreateFiles(description.file))){
 		all.authors <- format(get.by.role(about[["author"]], role="aut"),
 			include=c("given", "family", "email"), braces=list(email=c("<", ">")))

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-25 19:49:28 UTC (rev 3833)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.pluginmap.Rd	2011-09-25 20:20:26 UTC (rev 3834)
@@ -2,8 +2,8 @@
 \alias{rk.XML.pluginmap}
 \title{Write a pluginmap file for RKWard}
 \usage{
-  rk.XML.pluginmap(name, about, components, plugin.dir =
-  "plugins", hierarchy = "analysis")
+  rk.XML.pluginmap(name, about = NULL, components,
+  plugin.dir = "plugins", hierarchy = "analysis")
 }
 \arguments{
   \item{name}{Character string, name of the plugin.}
@@ -11,7 +11,7 @@
   \item{about}{A list with descriptive information on the
   plugin,its authors and dependencies. See
   \code{link[XiMpLe:rk.XML.about]{rk.XML.about}} for
-  details!}
+  details! Skipped if \code{NULL}.}
 
   \item{components}{A character vector with at least one
   plugin component file name, ending with ".xml".}

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-25 19:49:28 UTC (rev 3833)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-25 20:20:26 UTC (rev 3834)
@@ -2,8 +2,8 @@
 \alias{rk.plugin.skeleton}
 \title{Create skeleton for RKWard plugins}
 \usage{
-  rk.plugin.skeleton(name, about, path = tempdir(), dialog
-  = list(), wiz.dialog = list(), dial.require = c(),
+  rk.plugin.skeleton(name, about = NULL, path = tempdir(),
+  dialog = list(), wiz.dialog = list(), dial.require = c(),
   overwrite = FALSE, wizard = FALSE, tests = TRUE, lazyLoad
   = TRUE, logic = NULL, JS.prep = NULL, JS.calc = NULL,
   JS.prnt = NULL, create = c("pmap", "xml", "js", "rkh",
@@ -16,7 +16,8 @@
   plugin, its authors and dependencies. At the very least
   you must specify \code{name} and \code{author}. See
   \code{\link[rkwarddev:rk.XML.about]{rk.XML.about}} for
-  details and a full list of elements!}
+  details and a full list of elements! If \code{NULL}, no
+  \code{DESCRIPTION} file will be created either.}
 
   \item{path}{Character sting, path to the main directory
   where the skeleton should be created.}

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