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

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Thu Sep 15 15:33:33 UTC 2011


Revision: 3785
          http://rkward.svn.sourceforge.net/rkward/?rev=3785&view=rev
Author:   m-eik
Date:     2011-09-15 15:33:33 +0000 (Thu, 15 Sep 2011)
Log Message:
-----------
rkwarddev: reworked rk.XML.about() to use person class objects for authors, and need less info

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.about.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/R/rkwarddev-package.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/inst/CITATION
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.about.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-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-15 15:33:33 UTC (rev 3785)
@@ -1,5 +1,9 @@
-ChangeLog for package rkwardplugdev
+ChangeLog for package rkwarddev
 
+## 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
+
 ## 0.01-1 (2011-09-05)
   - added rk.JS.scan(), rk.JS.doc(), rk.JS.array(), rk.rkh.scan() and rk.rkh.doc()
   - added rk.XML.browser(),  rk.XML.input(),  rk.XML.saveobj(),  rk.XML.stretch() and  rk.XML.text()

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-15 15:33:33 UTC (rev 3785)
@@ -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-1
-Date: 2011-09-12
+Version: 0.01-2
+Date: 2011-09-15
 Collate:
     'rk-internal.R'
     'rk.JS.array.R'
@@ -28,6 +28,7 @@
     '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'

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R	2011-09-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk-internal.R	2011-09-15 15:33:33 UTC (rev 3785)
@@ -114,7 +114,7 @@
 		results <- paste(indent.by, "var ", camelCode(c(JS.prefix, JS.var)), " = getValue(\"", XML.var, "\");\n", sep="")
 	}
 	return(results)
-} ## function get.JS.vars()
+} ## end function get.JS.vars()
 
 ## function ID.prefix()
 ID.prefix <- function(initial, abbr=TRUE, length=3, dot=TRUE){
@@ -128,4 +128,12 @@
 		prfx <- paste(prfx, ".", sep="")
 	} else {}
 	return(prfx)
-}
+} ## end function ID.prefix()
+
+## function get.by.role()
+# filters a vector with person objects by roles
+get.by.role <- function(persons, role="aut"){
+	role.filter <- function(x){is.null(r <- x$role) | role %in% r}
+	filtered.persons <- Filter(role.filter, persons)
+	return(filtered.persons)
+} ## end function get.by.role()

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.about.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.about.R	2011-09-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.about.R	2011-09-15 15:33:33 UTC (rev 3785)
@@ -1,57 +1,59 @@
 #' Create XML node "about" for RKWard pluginmaps
 #'
-#' @param about A named list with these elements:
+#' @param name A character string with the plugin name.
+#' @param author A vector of objects of class \code{person} with these elements (mandatory):
 #'		\describe{
-#'			\item{name}{Plugin name}
-#'			\item{desc}{A short description}
-#'			\item{version}{Plugin version}
-#'			\item{date}{Release date}
-#'			\item{url}{URL for the plugin}
-#'			\item{license}{License the plugin is distributed under}
-#'			\item{category}{An optional category}
+#'			\item{given}{Author given name}
+#'			\item{family}{Author family name}
+#'			\item{email}{Author mail address}
+#'			\item{role}{This person's specific role, e.g. \code{"aut"} for actual author, \code{"cre"} for maintainer or \code{"ctb"} for contributor.}
 #'		}
-#' @param author A list of named character vectors with these elements:
+#'		See \code{\link[utils:person]{person}} for more details on this, especially for valid roles.
+#' @param about A named list with these elements:
 #'		\describe{
-#'			\item{name}{Full author name}
-#'			\item{email}{Author mail address}
-#'			\item{url}{Author homepage}
+#'			\item{desc}{A short description (mandatory)}
+#'			\item{version}{Plugin version (mandatory)}
+#'			\item{date}{Release date (mandatory)}
+#'			\item{url}{URL for the plugin (optional)}
+#'			\item{license}{License the plugin is distributed under (mandatory)}
+#'			\item{category}{A category for this plugin (optional)}
 #'		}
 #' @param dependencies A named list with these elements:
 #'		\describe{
-#'			\item{rkward.min}{Minimum RKWard version needed for this plugin}
-#'			\item{rkward.max}{Maximum RKWard version needed for this plugin}
-#'			\item{R.min}{Minimum R version needed for this plugin}
-#'			\item{R.max}{Maximum R version needed for this plugin}
+#'			\item{rkward.min}{Minimum RKWard version needed for this plugin (optional)}
+#'			\item{rkward.max}{Maximum RKWard version needed for this plugin (optional)}
+#'			\item{R.min}{Minimum R version needed for this plugin (optional)}
+#'			\item{R.max}{Maximum R version needed for this plugin (optional)}
 #'		}
 #' @param package A list of named character vectors, each with these elements:
 #'		\describe{
-#'			\item{name}{Name of a package this plugin depends on}
-#'			\item{min}{Minimum version of the package}
-#'			\item{max}{Maximum version of the package}
-#'			\item{repository}{Repository to download the package}
+#'			\item{name}{Name of a package this plugin depends on (optional)}
+#'			\item{min}{Minimum version of the package (optional)}
+#'			\item{max}{Maximum version of the package (optional)}
+#'			\item{repository}{Repository to download the package (optional)}
 #'		}
 #' @param pluginmap A named list with these elements:
 #'		\describe{
-#'			\item{name}{Identifier of a pluginmap this plugin depends on}
-#'			\item{url}{URL to get the pluginmap}
+#'			\item{name}{Identifier of a pluginmap this plugin depends on (optional)}
+#'			\item{url}{URL to get the pluginmap (optional)}
 #'		}
 #' @export
 #' @examples
 #' about.node <- rk.XML.about(
+#' 	name="Square the circle",
+#' 	author=c(
+#' 		person(given="E.A.", family="Dölle",
+#' 			email="doelle@@eternalwondermaths.example.org", role="aut"),
+#' 		person(given="A.", family="Assistant",
+#' 			email="alterego@@eternalwondermaths.example.org", role=c("cre","ctb"))
+#' 		),
 #' 	about=list(
-#' 		name="Square the circle",
 #' 		desc="Squares the circle using Heisenberg compensation.",
 #' 		version="0.1-3",
 #' 		date=Sys.Date(),
 #' 		url="http://eternalwondermaths.example.org/23/stc.html",
 #' 		license="GPL",
 #' 		category="Geometry"),
-#' 	author=list(
-#' 		c(name="E.A. Dölle", email="doelle@@eternalwondermaths.example.org",
-#' 			url="http://eternalwondermaths.example.org"),
-#' 		c(name="A. Assistant", email="alterego@@eternalwondermaths.example.org",
-#' 			url="http://eternalwondermaths.example.org/staff/")
-#' 		),
 #' 	dependencies=list(
 #' 		rkward.min="0.5.3",
 #' 		rkward.max="",
@@ -68,22 +70,42 @@
 #' cat(pasteXMLNode(about.node))
 
 
-rk.XML.about <- function(about, author, dependencies=NULL, package=NULL, pluginmap=NULL){
+rk.XML.about <- function(name, author, about=list(desc="SHORT_DESCRIPTION", version="0.01-0", date=Sys.Date(), url="http://EXAMPLE.com", license="GPL (>= 3)"), dependencies=NULL, package=NULL, pluginmap=NULL){
 	# sanity checks
-	stopifnot(all(c("name", "desc", "version", "date", "license") %in% names(about)))
-	stopifnot(all(length(about[c("name", "desc", "version", "date", "license")]) > 0))
+	stopifnot(all(length(name), length(author)) > 0)
+	if(is.null(about)){
+		about <- list()
+	} else {}
+	if(!"desc" %in% names(about)){
+		about[["desc"]] <- "SHORT_DESCRIPTION"
+	} else {}
+	if(!"version" %in% names(about)){
+		about[["version"]] <- "0.01-0"
+	} else {}
+	if(!"date" %in% names(about)){
+		about[["date"]] <- Sys.Date()
+	} else {}
+	if(!"url" %in% names(about)){
+		about[["url"]] <- "http://EXAMPLE.com"
+	} else {}
+	if(!"license" %in% names(about)){
+		about[["license"]] <- "GPL (>= 3)"
+	} else {}
 
 	## author
-	# - name
+	# - given
+	# - family
 	# - email
-	# - url
+	# - role
 	xml.authors <- unlist(sapply(author, function(this.author){
-			author.name  <- this.author[["name"]]
-			author.email <- this.author[["email"]]
-			author.url   <- this.author[["url"]]
+			stopifnot(all(c("given", "family", "email") %in% names(unlist(this.author))))
+			author.given  <- format(this.author, include="given")
+			author.family <- format(this.author, include="family")
+			author.email  <- format(this.author, include="email", braces=list(email=""))
+			author.role   <- format(this.author, include="role", braces=list(role=""), collapse=list(role=", "))
 			result <- new("XiMpLe.node",
 				name="author",
-				attributes=list(name=author.name, email=author.email, url=author.url))
+				attributes=list(given=author.given, family=author.family, email=author.email, role=author.role))
 			return(result)
 		}))
 
@@ -92,30 +114,65 @@
 	# - min="min_version",
 	# - max="max_version",
 	# - repository
-	xml.package <- sapply(package, function(this.package){
-			result <- new("XiMpLe.node",
+	# create example, if empty
+	if(is.null(package)){
+		xml.package.example <- new("XiMpLe.node",
 				name="package",
 				attributes=list(
-					name=this.package[["name"]],
-					"min_version"=this.package[["min"]],
-					"max_version"=this.package[["max"]],
-					repository=this.package[["repository"]]
-				))
-			return(result)
-		})
+					name="CHANGE_ME_OR_DELETE_ME",
+					"min_version"="CHANGE_ME_OR_DELETE_ME",
+					"max_version"="CHANGE_ME_OR_DELETE_ME",
+					repository="CHANGE_ME_OR_DELETE_ME"
+					))
+		xml.package <- list(new("XiMpLe.node",
+					name="!--",
+					children=list(xml.package.example)
+			))
+	} else {
+		xml.package <- sapply(package, function(this.package){
+				result <- new("XiMpLe.node",
+					name="package",
+					attributes=list(
+						name=this.package[["name"]],
+						"min_version"=this.package[["min"]],
+						"max_version"=this.package[["max"]],
+						repository=this.package[["repository"]]
+					))
+				return(result)
+			})
+	}
 
 	## pluginmap
 	# - name,
 	# - url
-	xml.pluginmap <- sapply(pluginmap, function(this.pluginmap){
-			result <- new("XiMpLe.node",
-				name="pluginmap",
-				attributes=list(
-					name=this.pluginmap[["name"]],
-					url=this.pluginmap[["url"]]
-				))
-			return(result)
-		})
+	# create example, if empty
+	if(is.null(pluginmap)){
+		xml.pluginmap.text <- new("XiMpLe.node",
+					name="",
+					value="If this plugin depends on other pluginmaps, edit this part to your needs:"
+		)
+		xml.pluginmap.example <- new("XiMpLe.node",
+					name="pluginmap",
+					attributes=list(
+						name="CHANGE_ME_OR_DELETE_ME",
+						url="CHANGE_ME_OR_DELETE_ME"
+					)
+			)
+		xml.pluginmap <- list(new("XiMpLe.node",
+					name="!--",
+					children=list(xml.pluginmap.text, xml.pluginmap.example)
+			))
+	} else {
+		xml.pluginmap <- sapply(pluginmap, function(this.pluginmap){
+				result <- new("XiMpLe.node",
+					name="pluginmap",
+					attributes=list(
+						name=this.pluginmap[["name"]],
+						url=this.pluginmap[["url"]]
+					))
+				return(result)
+			})
+	}
 
 	## dependencies
 	# - rkward.min="rkward_min_version",
@@ -124,29 +181,41 @@
 	# - R.max="R_max_verion"
 	# + package
 	# + pluginmap
-	if(!is.null(xml.pluginmap)){
-		for (pmap in xml.pluginmap){
-			xml.package[[length(xml.package)+1]] <- pmap
-		}
-	} else {}
-	if(is.null(xml.package)){
-		xml.package <- list()
-	} else {}
-	xml.dependencies <-  new("XiMpLe.node",
-				name="dependencies",
-				attributes=list(
-					"rkward_min_version"=dependencies[["rkward.min"]],
-					"rkward_max_version"=dependencies[["rkward.max"]],
-					"R_min_verion"=dependencies[["R.min"]],
-					"R_max_verion"=dependencies[["R.max"]]
-				),
-				children=xml.package,
-				value=""
+	for (pmap in xml.pluginmap){
+		xml.package[[length(xml.package)+1]] <- pmap
+	}
+	# comment out an example dependency listing if it has no entries
+	if(is.null(dependencies)){
+		R.v <- R.Version()
+		xml.dependencies.text <- new("XiMpLe.node",
+					name="!--",
+					value="If this plugin has dependencies, edit this part to your needs:"
 		)
-	# skip dependency listing if it has no entries
-	if(all(sapply(xml.dependencies at attributes, is.null)) & length(xml.dependencies at children) == 0){
-		xml.dependencies <- NULL
-	} else {}
+		xml.authors[[length(xml.authors)+1]] <- xml.dependencies.text
+		xml.dependencies <- new("XiMpLe.node",
+					name="dependencies",
+					attributes=list(
+						"rkward_min_version"=.rk.app.version,
+						"rkward_max_version"="CHANGE_ME_OR_DELETE_ME",
+						"R_min_verion"=paste(R.v$major, R.v$minor, sep="."),
+						"R_max_verion"="CHANGE_ME_OR_DELETE_ME"
+					),
+					children=xml.package,
+					value=""
+			)
+	} else {
+		xml.dependencies <- new("XiMpLe.node",
+					name="dependencies",
+					attributes=list(
+						"rkward_min_version"=dependencies[["rkward.min"]],
+						"rkward_max_version"=dependencies[["rkward.max"]],
+						"R_min_verion"=dependencies[["R.min"]],
+						"R_max_verion"=dependencies[["R.max"]]
+					),
+					children=xml.package,
+					value=""
+			)
+	}
 
 	## about
 	# - name
@@ -158,16 +227,14 @@
 	# - category
 	# + authors
 	# + dependencies
-	if(!is.null(xml.dependencies)){
-		xml.authors[[length(xml.authors)+1]] <- xml.dependencies
-	} else {}
+	xml.authors[[length(xml.authors)+1]] <- xml.dependencies
 	if(is.null(xml.authors)){
 		xml.authors <- list()
 	} else {}
 	xml.about <-  new("XiMpLe.node",
 				name="about",
 				attributes=list(
-					name=about[["name"]],
+					name=name,
 					"shortinfo"=about[["desc"]],
 					version=about[["version"]],
 					"releasedate"=about[["date"]],

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-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.XML.pluginmap.R	2011-09-15 15:33:33 UTC (rev 3785)
@@ -24,8 +24,9 @@
 	# - components
 	# - hierarchy
 	about.XML <- rk.XML.about(
+		name=name.orig,
+		author=about[["author"]],
 		about=about[["about"]],
-		author=about[["author"]],
 		dependencies=about[["dependencies"]],
 		package=about[["package"]],
 		pluginmap=about[["pluginmap"]])

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-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-15 15:33:33 UTC (rev 3785)
@@ -1,9 +1,10 @@
 #' Create skeleton for RKWard plugins
 #'
 #' @param name Character sting, name of the plugin package.
+#' @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[XiMpLe:rk.XML.about]{rk.XML.about}} for details and a full list of elements!
 #' @param path Character sting, path to the main directory where the skeleton should be created.
-#' @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!
 #' @param dialog A list of objects of class XiMpLe.node. If provided, will be included in the
 #'		created plugin XML file as the dialog.
 #' @param dial.require A character vector with names of R packages that the dialog requires.
@@ -13,21 +14,34 @@
 #' @export
 #' @examples
 #' \dontrun{
+#' # a simple example with only basic information
 #' about.info <- list(
+#' 	name="Square the circle",
+#' 	author=c(
+#' 		person(given="E.A.", family="Dölle",
+#' 			email="doelle@@eternalwondermaths.example.org", role="aut"),
+#' 		person(given="A.", family="Assistant",
+#' 			email="alterego@@eternalwondermaths.example.org", role=c("cre","ctb"))
+#' 		))
+#' 
+#' rk.plugin.skeleton("Square the Circle", about=about.info)
+#' 
+#' # a more complex example, already including some dialog elements
+#' about.info <- list(
+#' 	name="Square the circle",
+#' 	author=c(
+#' 		person(given="E.A.", family="Dölle",
+#' 			email="doelle@@eternalwondermaths.example.org", role="aut"),
+#' 		person(given="A.", family="Assistant",
+#' 			email="alterego@@eternalwondermaths.example.org", role=c("cre","ctb"))
+#' 		),
 #' 	about=list(
-#' 		name="Square the circle",
 #' 		desc="Squares the circle using Heisenberg compensation.",
 #' 		version="0.1-3",
 #' 		date=Sys.Date(),
 #' 		url="http://eternalwondermaths.example.org/23/stc.html",
 #' 		license="GPL",
 #' 		category="Geometry"),
-#' 	author=list(
-#' 		c(name="E.A. Dölle", email="doelle@@eternalwondermaths.example.org",
-#' 			url="http://eternalwondermaths.example.org"),
-#' 		c(name="A. Assistant", email="alterego@@eternalwondermaths.example.org",
-#' 			url="http://eternalwondermaths.example.org/staff/")
-#' 		),
 #' 	dependencies=list(
 #' 		rkward.min="0.5.3",
 #' 		rkward.max="",
@@ -40,10 +54,7 @@
 #' 	pluginmap=list(
 #' 		c(name="heisenberg.pluginmap", url="http://eternalwondermaths.example.org/hsb"))
 #' )
-#' 
-#' rk.plugin.skeleton("Square the Circle", path="/tmp", about=about.info)
-#' 
-#' # a more complex example, already including some dialog elements
+#'
 #' test.dropdown <- rk.XML.dropdown("mydrop",
 #'   opts=list("First Option"=c(val="val1"),
 #'   "Second Option"=c(val="val2", chk=TRUE)))
@@ -58,17 +69,26 @@
 #' test.plugin <- rk.XML.plugin("My test", label="Check this out",
 #'   children=test.tabbook)
 #' 
-#' rk.plugin.skeleton("Square the Circle", path="/tmp",
-#'   about=about.info, dialog=test.tabbook, overwrite=TRUE)
+#' rk.plugin.skeleton("Square the Circle", about=about.info,
+#'   dialog=test.tabbook, overwrite=TRUE)
 #' }
 
-rk.plugin.skeleton <- function(name, path, about, dialog=list(), dial.require=c(), overwrite=FALSE, tests=TRUE){
+rk.plugin.skeleton <- function(name, about, path=tempdir(), dialog=list(), dial.require=c(), overwrite=FALSE, tests=TRUE, lazyLoad=TRUE){
 	# to besure, remove all non-character symbols from name
 	name.orig <- name
 	name <- gsub("[[:space:]]*[^[:alnum:]]*", "", name)
 	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"]]
+	)
 	# define paths an file names
 	main.dir <- file.path(path, name)
 	description.file <- file.path(main.dir, "DESCRIPTION")
@@ -136,7 +156,7 @@
 	## create plugin.pluginmap
 	if(isTRUE(checkCreateFiles(plugin.pluginmap))){
 		XML.pluginmap <- rk.XML.pluginmap(
-			name=name,
+			name=name.orig,
 			about=about,
 			components=paste(name, ".xml", sep=""),
 			plugin.dir="plugins",
@@ -152,29 +172,34 @@
 
 	# create DESCRIPTION file
 	if(isTRUE(checkCreateFiles(description.file))){
-		all.authors <- paste(
-			sapply(about.info[["author"]], function(this.author){
-				paste(this.author[["name"]], " <", this.author[["email"]], ">", sep="")
-			}),
-		collapse=", ")
+		all.authors <- format(get.by.role(about[["author"]], role="aut"),
+			include=c("given", "family", "email"), braces=list(email=c("<", ">")))
+		all.maintainers <- format(get.by.role(about[["author"]], role="cre"),
+			include=c("given", "family", "email"), braces=list(email=c("<", ">")))
+
 ## TODO: check and add the commented values here:
 		desc <- data.frame(
 			Package=name,
 			Type="Package",
-			Title=about[["about"]][["name"]],
-			Version=about[["about"]][["version"]],
-			Date=about[["about"]][["date"]],
+			Title=about.node at attributes[["name"]],
+			Version=about.node at attributes[["version"]],
+			Date=about.node at attributes[["releasedate"]],
 			Author=all.authors,
-#			AuthorR="c(person(given=\"X\", family=\"YZ\", email=\"some at example.de\"))",
-			Maintainer=all.authors,
+			AuthorsR=paste(deparse(about.info[["author"]]), collapse=" "),
+			Maintainer=all.maintainers,
 #			Depends="R (>= 2.9.0)",
 			Enhances="rkward",
-			Description=about[["about"]][["desc"]],
-			License=about[["about"]][["license"]],
+			Description=about.node at attributes[["shortinfo"]],
+			License=about.node at attributes[["license"]],
 #			Encoding="UTF-8",
-#			LazyLoad="yes",
-			URL=about[["about"]][["url"]],
+			LazyLoad=ifelse(isTRUE(lazyLoad), "yes", "no"),
+			URL=about.node at attributes[["url"]],
 			stringsAsFactors=FALSE)
+
+		# i have no clue how to circumvent this workaround:
+		desc$`Authors at R` <- desc[["AuthorsR"]]
+		desc <- subset(desc, select=-AuthorsR)
+
 		write.dcf(desc, file=description.file)
 	} else {}
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-15 15:33:33 UTC (rev 3785)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.01-1\cr
-#' Date: \tab 2011-09-12\cr
+#' Version: \tab 0.01-2\cr
+#' Date: \tab 2011-09-15\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-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/inst/CITATION	2011-09-15 15:33:33 UTC (rev 3785)
@@ -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-1)",
+		note="(Version 0.01-2)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2011). ",
-				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.01-1). ",
+				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.01-2). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.about.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.about.Rd	2011-09-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.XML.about.Rd	2011-09-15 15:33:33 UTC (rev 3785)
@@ -2,60 +2,73 @@
 \alias{rk.XML.about}
 \title{Create XML node "about" for RKWard pluginmaps}
 \usage{
-  rk.XML.about(about, author, dependencies = NULL, package
-  = NULL, pluginmap = NULL)
+  rk.XML.about(name, author, about = list(desc =
+  "SHORT_DESCRIPTION", version = "0.01-0", date =
+  Sys.Date(), url = "http://EXAMPLE.com", license = "GPL
+  (>= 3)"), dependencies = NULL, package = NULL, pluginmap
+  = NULL)
 }
 \arguments{
+  \item{name}{A character string with the plugin name.}
+
+  \item{author}{A vector of objects of class \code{person}
+  with these elements (mandatory): \describe{
+  \item{given}{Author given name} \item{family}{Author
+  family name} \item{email}{Author mail address}
+  \item{role}{This person's specific role, e.g.
+  \code{"aut"} for actual author, \code{"cre"} for
+  maintainer or \code{"ctb"} for contributor.} } See
+  \code{\link[utils:person]{person}} for more details on
+  this, especially for valid roles.}
+
   \item{about}{A named list with these elements: \describe{
-  \item{name}{Plugin name} \item{desc}{A short description}
-  \item{version}{Plugin version} \item{date}{Release date}
-  \item{url}{URL for the plugin} \item{license}{License the
-  plugin is distributed under} \item{category}{An optional
-  category} }}
+  \item{desc}{A short description (mandatory)}
+  \item{version}{Plugin version (mandatory)}
+  \item{date}{Release date (mandatory)} \item{url}{URL for
+  the plugin (optional)} \item{license}{License the plugin
+  is distributed under (mandatory)} \item{category}{A
+  category for this plugin (optional)} }}
 
-  \item{author}{A list of named character vectors with
-  these elements: \describe{ \item{name}{Full author name}
-  \item{email}{Author mail address} \item{url}{Author
-  homepage} }}
-
   \item{dependencies}{A named list with these elements:
   \describe{ \item{rkward.min}{Minimum RKWard version
-  needed for this plugin} \item{rkward.max}{Maximum RKWard
-  version needed for this plugin} \item{R.min}{Minimum R
-  version needed for this plugin} \item{R.max}{Maximum R
-  version needed for this plugin} }}
+  needed for this plugin (optional)}
+  \item{rkward.max}{Maximum RKWard version needed for this
+  plugin (optional)} \item{R.min}{Minimum R version needed
+  for this plugin (optional)} \item{R.max}{Maximum R
+  version needed for this plugin (optional)} }}
 
   \item{package}{A list of named character vectors, each
   with these elements: \describe{ \item{name}{Name of a
-  package this plugin depends on} \item{min}{Minimum
-  version of the package} \item{max}{Maximum version of the
-  package} \item{repository}{Repository to download the
-  package} }}
+  package this plugin depends on (optional)}
+  \item{min}{Minimum version of the package (optional)}
+  \item{max}{Maximum version of the package (optional)}
+  \item{repository}{Repository to download the package
+  (optional)} }}
 
   \item{pluginmap}{A named list with these elements:
   \describe{ \item{name}{Identifier of a pluginmap this
-  plugin depends on} \item{url}{URL to get the pluginmap}
-  }}
+  plugin depends on (optional)} \item{url}{URL to get the
+  pluginmap (optional)} }}
 }
 \description{
   Create XML node "about" for RKWard pluginmaps
 }
 \examples{
 about.node <- rk.XML.about(
+name="Square the circle",
+author=c(
+person(given="E.A.", family="Dölle",
+email="doelle at eternalwondermaths.example.org", role="aut"),
+person(given="A.", family="Assistant",
+email="alterego at eternalwondermaths.example.org", role=c("cre","ctb"))
+),
 about=list(
-name="Square the circle",
 desc="Squares the circle using Heisenberg compensation.",
 version="0.1-3",
 date=Sys.Date(),
 url="http://eternalwondermaths.example.org/23/stc.html",
 license="GPL",
 category="Geometry"),
-author=list(
-c(name="E.A. Dölle", email="doelle at eternalwondermaths.example.org",
-url="http://eternalwondermaths.example.org"),
-c(name="A. Assistant", email="alterego at eternalwondermaths.example.org",
-url="http://eternalwondermaths.example.org/staff/")
-),
 dependencies=list(
 rkward.min="0.5.3",
 rkward.max="",

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-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-15 15:33:33 UTC (rev 3785)
@@ -2,20 +2,22 @@
 \alias{rk.plugin.skeleton}
 \title{Create skeleton for RKWard plugins}
 \usage{
-  rk.plugin.skeleton(name, path, about, dialog = list(),
-  dial.require = c(), overwrite = FALSE, tests = TRUE)
+  rk.plugin.skeleton(name, about, path = tempdir(), dialog
+  = list(), dial.require = c(), overwrite = FALSE, tests =
+  TRUE, lazyLoad = TRUE)
 }
 \arguments{
   \item{name}{Character sting, name of the plugin package.}
 
+  \item{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[XiMpLe:rk.XML.about]{rk.XML.about}} for
+  details and a full list of elements!}
+
   \item{path}{Character sting, path to the main directory
   where the skeleton should be created.}
 
-  \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!}
-
   \item{dialog}{A list of objects of class XiMpLe.node. If
   provided, will be included in the created plugin XML file
   as the dialog.}
@@ -34,21 +36,34 @@
 }
 \examples{
 \dontrun{
+# a simple example with only basic information
 about.info <- list(
+name="Square the circle",
+author=c(
+person(given="E.A.", family="Dölle",
+email="doelle at eternalwondermaths.example.org", role="aut"),
+person(given="A.", family="Assistant",
+email="alterego at eternalwondermaths.example.org", role=c("cre","ctb"))
+))
+
+rk.plugin.skeleton("Square the Circle", about=about.info)
+
+# a more complex example, already including some dialog elements
+about.info <- list(
+name="Square the circle",
+author=c(
+person(given="E.A.", family="Dölle",
+email="doelle at eternalwondermaths.example.org", role="aut"),
+person(given="A.", family="Assistant",
+email="alterego at eternalwondermaths.example.org", role=c("cre","ctb"))
+),
 about=list(
-name="Square the circle",
 desc="Squares the circle using Heisenberg compensation.",
 version="0.1-3",
 date=Sys.Date(),
 url="http://eternalwondermaths.example.org/23/stc.html",
 license="GPL",
 category="Geometry"),
-author=list(
-c(name="E.A. Dölle", email="doelle at eternalwondermaths.example.org",
-url="http://eternalwondermaths.example.org"),
-c(name="A. Assistant", email="alterego at eternalwondermaths.example.org",
-url="http://eternalwondermaths.example.org/staff/")
-),
 dependencies=list(
 rkward.min="0.5.3",
 rkward.max="",
@@ -62,9 +77,6 @@
 c(name="heisenberg.pluginmap", url="http://eternalwondermaths.example.org/hsb"))
 )
 
-rk.plugin.skeleton("Square the Circle", path="/tmp", about=about.info)
-
-# a more complex example, already including some dialog elements
 test.dropdown <- rk.XML.dropdown("mydrop",
 opts=list("First Option"=c(val="val1"),
 "Second Option"=c(val="val2", chk=TRUE)))
@@ -79,8 +91,8 @@
 test.plugin <- rk.XML.plugin("My test", label="Check this out",
 children=test.tabbook)
 
-rk.plugin.skeleton("Square the Circle", path="/tmp",
-about=about.info, dialog=test.tabbook, overwrite=TRUE)
+rk.plugin.skeleton("Square the Circle", about=about.info,
+dialog=test.tabbook, overwrite=TRUE)
 }
 }
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-15 15:24:14 UTC (rev 3784)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-15 15:33:33 UTC (rev 3785)
@@ -8,8 +8,8 @@
 }
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
-  Package\cr Version: \tab 0.01-1\cr Date: \tab
-  2011-09-12\cr Depends: \tab R (>= 2.9.0), XiMpLe\cr
+  Package\cr Version: \tab 0.01-2\cr Date: \tab
+  2011-09-15\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