[rkward-cvs] SF.net SVN: rkward-code:[4759] trunk/rkward/packages/rkwarddev

m-eik at users.sf.net m-eik at users.sf.net
Fri Jul 5 14:14:17 UTC 2013


Revision: 4759
          http://sourceforge.net/p/rkward/code/4759
Author:   m-eik
Date:     2013-07-05 14:14:16 +0000 (Fri, 05 Jul 2013)
Log Message:
-----------
rkwarddev: make it possible to supress the generation of empty nodes in .rkh files (hints=FALSE)

Modified Paths:
--------------
    trunk/rkward/packages/rkwarddev/ChangeLog
    trunk/rkward/packages/rkwarddev/DESCRIPTION
    trunk/rkward/packages/rkwarddev/R/rk.plugin.component.R
    trunk/rkward/packages/rkwarddev/R/rk.rkh.doc.R
    trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/packages/rkwarddev/inst/CITATION
    trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
    trunk/rkward/packages/rkwarddev/man/rk.plugin.component.Rd
    trunk/rkward/packages/rkwarddev/man/rk.rkh.doc.Rd
    trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
    trunk/rkward/packages/rkwarddev/man/tf.Rd

Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/ChangeLog	2013-07-05 14:14:16 UTC (rev 4759)
@@ -1,5 +1,12 @@
 ChangeLog for package rkwarddev
 
+changes in version 0.06-3 (2013-07-05)
+fixed:
+  - fixed outdated example code for rk.plugin.component()
+changed:
+  - rk.plugin.component() and rk.rkh.doc() do now interpret the "hints" argument to prevent the
+    generation of optional XML nodes.
+
 changes in version 0.06-2 (2013-04-04)
 changed:
   - the structure of <about> nodes will change in RKWard 0.6.1,

Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION	2013-07-05 14:14:16 UTC (rev 4759)
@@ -6,16 +6,16 @@
 Depends:
     R (>= 2.9.0),methods,XiMpLe (>= 0.03-18),rkward (>= 0.5.6)
 Enhances: rkward
-Description: Provides functions to create plugin skeletons and XML structures
-    for RKWard.
+Description: Provides functions to create plugin skeletons and XML
+    structures for RKWard.
 License: GPL (>= 3)
 Encoding: UTF-8
 LazyLoad: yes
 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.06-2
-Date: 2013-04-04
+Version: 0.06-3
+Date: 2013-07-05
 Collate:
     'echo.R'
     'id.R'

Modified: trunk/rkward/packages/rkwarddev/R/rk.plugin.component.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.plugin.component.R	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/R/rk.plugin.component.R	2013-07-05 14:14:16 UTC (rev 4759)
@@ -29,6 +29,7 @@
 #'				the \code{<settings>} section of the help file. This option will be overruled if you provide that section manually
 #'				by the \code{rkh} option (see below).}
 #'		}
+#' @param hints Logical, if \code{TRUE} and you leave optional entries empty (like \code{rkh=list()}), dummy sections will be added.
 #' @param guess.getter Logical, if \code{TRUE} try to get a good default getter function for JavaScript
 #'		variable values (if \code{scan} is active). This will use some functions which were added with RKWard 0.6.1, and therefore
 #'		raise the dependencies for your plugin/component accordingly. Nonetheless, it's recommended.
@@ -52,7 +53,7 @@
 #' @examples
 #' \dontrun{
 #' test.dropdown <- rk.XML.dropdown("mydrop",
-#'   opts=list("First Option"=c(val="val1"),
+#'   options=list("First Option"=c(val="val1"),
 #'   "Second Option"=c(val="val2", chk=TRUE)))
 #' test.checkboxes <- rk.XML.row(rk.XML.col(
 #'   list(test.dropdown,
@@ -60,8 +61,8 @@
 #'     rk.XML.cbox(label="bar", val="bar2"))
 #'   ))
 #' test.vars <- rk.XML.vars("select some vars", "vars go here")
-#' test.tabbook <- rk.XML.dialog(rk.XML.tabbook("My Tabbook", tab.labels=c("First Tab",
-#'   "Second Tab"), children=list(test.checkboxes, test.vars)))
+#' test.tabbook <- rk.XML.dialog(rk.XML.tabbook("My Tabbook",
+#'   tabs=c("First Tab"=test.checkboxes, "Second Tab"=test.vars)))
 #' 
 #' rk.plugin.component("Square the Circle",
 #'   xml=list(dialog=test.tabbook))
@@ -69,7 +70,7 @@
 
 rk.plugin.component <- function(about, xml=list(), js=list(), rkh=list(),
 	provides=c("logic", "dialog"), scan=c("var", "saveobj", "settings"), guess.getter=FALSE,
-	hierarchy="test", include=NULL, create=c("xml", "js", "rkh"), gen.info=TRUE, indent.by="\t"){
+	hierarchy="test", include=NULL, create=c("xml", "js", "rkh"), hints=TRUE, gen.info=TRUE, indent.by="\t"){
 
 	if(inherits(about, "XiMpLe.node")){
 		about.node.name <- slot(about, "name")
@@ -198,10 +199,11 @@
 			related=rkh[["related"]],
 			technical=rkh[["technical"]],
 			title=rk.rkh.title(name.orig),
+			hints=hints,
 			gen.info=gen.info)
 		slot(this.component, "rkh") <- rkh.doc
 	} else {
-		slot(this.component, "rkh") <- rk.rkh.doc()
+		slot(this.component, "rkh") <- rk.rkh.doc(hints=hints)
 	}
 
 	return(this.component)

Modified: trunk/rkward/packages/rkwarddev/R/rk.rkh.doc.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.rkh.doc.R	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/R/rk.rkh.doc.R	2013-07-05 14:14:16 UTC (rev 4759)
@@ -15,6 +15,7 @@
 #'		\code{\link[rkwarddev:rk.rkh.technical]{rk.rkh.technical}} for details.
 #' @param title An object of class \code{XiMpLe.node} to be pasted as the \code{<title>} section. See
 #'		\code{\link[rkwarddev:rk.rkh.title]{rk.rkh.title}} for details.
+#' @param hints Logical, if \code{TRUE} and you leave out optional entries (like \code{technical=NULL}), empty dummy sections will be added.
 #' @param gen.info Logical, if \code{TRUE} a comment note will be written into the document,
 #'		that it was generated by \code{rkwarddev} and changes should be done to the script.
 #' @return An object of class \code{XiMpLe.doc}.
@@ -28,7 +29,7 @@
 #'		and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
 #' @export
 
-rk.rkh.doc <- function(summary=NULL, usage=NULL, sections=NULL, settings=NULL, related=NULL, technical=NULL, title=NULL, gen.info=TRUE){
+rk.rkh.doc <- function(summary=NULL, usage=NULL, sections=NULL, settings=NULL, related=NULL, technical=NULL, title=NULL, hints=TRUE, gen.info=TRUE){
 
 	all.children <- list()
 
@@ -49,9 +50,7 @@
 		all.children[[length(all.children)+1]] <- title
 	} else {}
 
-	if(is.null(summary)){
-		all.children[[length(all.children)+1]] <- rk.rkh.summary()
-	} else {
+	if(!is.null(summary)){
 		# check if this is *really* a summary section
 		if(inherits(summary, "XiMpLe.node")){
 			summary.node.name <- slot(summary, "name")
@@ -62,11 +61,11 @@
 			stop(simpleError("I don't know what this is, but 'summary' is not a summary section!"))
 		} else {}
 		all.children[[length(all.children)+1]] <- summary
-	}
+	} else if(isTRUE(hints)){
+		all.children[[length(all.children)+1]] <- rk.rkh.summary()
+	} else {}
 
-	if(is.null(usage)){
-		all.children[[length(all.children)+1]] <- rk.rkh.usage()
-	} else {
+	if(!is.null(usage)){
 		# check if this is *really* a usage section
 		if(inherits(usage, "XiMpLe.node")){
 			usage.node.name <- slot(usage, "name")
@@ -77,12 +76,11 @@
 			stop(simpleError("I don't know what this is, but 'usage' is not a usage section!"))
 		} else {}
 		all.children[[length(all.children)+1]] <- usage
-	}
+	} else if(isTRUE(hints)){
+		all.children[[length(all.children)+1]] <- rk.rkh.usage()
+	} else {}
 
-	if(is.null(sections)){
-		all.children[[length(all.children)+1]] <- XMLNode("!--",
-				rk.rkh.section("EDIT OR DELETE ME", text="EDIT OR DELETE ME"))
-	} else {
+	if(!is.null(sections)){
 		for(this.section in sections){
 			# check if this is *really* a section
 			if(inherits(this.section, "XiMpLe.node")){
@@ -96,11 +94,12 @@
 
 			all.children[[length(all.children)+1]] <- this.section
 		}
-	}
+	} else if(isTRUE(hints)){
+		all.children[[length(all.children)+1]] <- XMLNode("!--",
+				rk.rkh.section("EDIT OR DELETE ME", text="EDIT OR DELETE ME"))
+	} else {}
 
-	if(is.null(settings)){
-		all.children[[length(all.children)+1]] <- rk.rkh.settings()
-	} else {
+	if(!is.null(settings)){
 		# check if this is *really* a settings section
 		if(inherits(settings, "XiMpLe.node")){
 			settings.node.name <- slot(settings, "name")
@@ -111,11 +110,11 @@
 			stop(simpleError("I don't know what this is, but 'settings' is not a settings section!"))
 		} else {}
 		all.children[[length(all.children)+1]] <- settings
-	}
+	} else if(isTRUE(hints)){
+		all.children[[length(all.children)+1]] <- rk.rkh.settings()
+	} else {}
 
-	if(is.null(related)){
-		all.children[[length(all.children)+1]] <- XMLNode("!--", rk.rkh.related(rk.rkh.link("...")))
-	} else {
+	if(!is.null(related)){
 		# check if this is *really* a related section
 		if(inherits(related, "XiMpLe.node")){
 			related.node.name <- slot(related, "name")
@@ -126,11 +125,11 @@
 			stop(simpleError("I don't know what this is, but 'related' is not a related section!"))
 		} else {}
 		all.children[[length(all.children)+1]] <- related
-	}
+	} else if(isTRUE(hints)){
+		all.children[[length(all.children)+1]] <- XMLNode("!--", rk.rkh.related(rk.rkh.link("...")))
+	} else {}
 
-	if(is.null(technical)){
-		all.children[[length(all.children)+1]] <- rk.rkh.technical()
-	} else {
+	if(!is.null(technical)){
 		# check if this is *really* a technical section
 		if(inherits(technical, "XiMpLe.node")){
 			technical.node.name <- slot(technical, "name")
@@ -141,7 +140,9 @@
 			stop(simpleError("I don't know what this is, but 'technical' is not a technical section!"))
 		} else {}
 		all.children[[length(all.children)+1]] <- technical
-	}
+	} else if(isTRUE(hints)){
+		all.children[[length(all.children)+1]] <- rk.rkh.technical()
+	} else {}
 
 	rkh.document <- XMLNode("document", .children=child.list(all.children, empty=FALSE))
 

Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2013-07-05 14:14:16 UTC (rev 4759)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.06-2\cr
-#' Date: \tab 2013-04-04\cr
+#' Version: \tab 0.06-3\cr
+#' Date: \tab 2013-07-05\cr
 #' Depends: \tab R (>= 2.9.0),methods,XiMpLe (>= 0.03-18),rkward (>= 0.5.6)\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr
@@ -15,7 +15,7 @@
 #'
 #' Provides functions to create plugin skeletons and XML structures for RKWard.
 #'
-#' @aliases rkwarddev-package rkwarddev
+#' @aliases rkwarddev-package
 #' @name rkwarddev-package
 #' @docType package
 #' @title The rkwarddev Package

Modified: trunk/rkward/packages/rkwarddev/inst/CITATION
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/CITATION	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/inst/CITATION	2013-07-05 14:14:16 UTC (rev 4759)
@@ -2,12 +2,12 @@
 		title="rkwarddev: A collection of tools for RKWard plugin development",
 		author="Meik Michalke",
 		year="2013",
-		note="(Version 0.06-2)",
+		note="(Version 0.06-3)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2013). ",
-				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.06-2). ",
+				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.06-3). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/NEWS.Rd	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/inst/NEWS.Rd	2013-07-05 14:14:16 UTC (rev 4759)
@@ -1,6 +1,14 @@
 \name{NEWS}
 \title{News for Package 'rkwarddev'}
 \encoding{UTF-8}
+\section{Changes in rkwarddev version 0.06-3 (2013-07-05)}{
+  \subsection{changed}{
+    \itemize{
+      \item \code{rk.plugin.component()} and \code{rk.rkh.doc()} do now interpret the \code{"hints"} argument to prevent the
+        generation of optional XML nodes.
+    }
+  }
+}
 \section{Changes in rkwarddev version 0.06-2 (2013-04-04)}{
   \subsection{changed}{
     \itemize{

Modified: trunk/rkward/packages/rkwarddev/man/rk.plugin.component.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.plugin.component.Rd	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/man/rk.plugin.component.Rd	2013-07-05 14:14:16 UTC (rev 4759)
@@ -7,7 +7,7 @@
     scan = c("var", "saveobj", "settings"),
     guess.getter = FALSE, hierarchy = "test",
     include = NULL, create = c("xml", "js", "rkh"),
-    gen.info = TRUE, indent.by = "\t")
+    hints = TRUE, gen.info = TRUE, indent.by = "\t")
 }
 \arguments{
   \item{about}{Either a character string with the name of
@@ -79,6 +79,10 @@
   section manually by the \code{rkh} option (see below).}
   }}
 
+  \item{hints}{Logical, if \code{TRUE} and you leave
+  optional entries empty (like \code{rkh=list()}), dummy
+  sections will be added.}
+
   \item{guess.getter}{Logical, if \code{TRUE} try to get a
   good default getter function for JavaScript variable
   values (if \code{scan} is active). This will use some

Modified: trunk/rkward/packages/rkwarddev/man/rk.rkh.doc.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.rkh.doc.Rd	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/man/rk.rkh.doc.Rd	2013-07-05 14:14:16 UTC (rev 4759)
@@ -4,7 +4,7 @@
 \usage{
   rk.rkh.doc(summary = NULL, usage = NULL, sections = NULL,
     settings = NULL, related = NULL, technical = NULL,
-    title = NULL, gen.info = TRUE)
+    title = NULL, hints = TRUE, gen.info = TRUE)
 }
 \arguments{
   \item{summary}{An object of class \code{XiMpLe.node} to
@@ -45,6 +45,10 @@
   \code{\link[rkwarddev:rk.rkh.title]{rk.rkh.title}} for
   details.}
 
+  \item{hints}{Logical, if \code{TRUE} and you leave out
+  optional entries (like \code{technical=NULL}), empty
+  dummy sections will be added.}
+
   \item{gen.info}{Logical, if \code{TRUE} a comment note
   will be written into the document, that it was generated
   by \code{rkwarddev} and changes should be done to the

Modified: trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2013-07-05 14:14:16 UTC (rev 4759)
@@ -1,6 +1,5 @@
 \docType{package}
 \name{rkwarddev-package}
-\alias{rkwarddev}
 \alias{rkwarddev-package}
 \title{The rkwarddev Package}
 \description{
@@ -8,8 +7,8 @@
 }
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
-  Package\cr Version: \tab 0.06-2\cr Date: \tab
-  2013-04-04\cr Depends: \tab R (>= 2.9.0),methods,XiMpLe
+  Package\cr Version: \tab 0.06-3\cr Date: \tab
+  2013-07-05\cr Depends: \tab R (>= 2.9.0),methods,XiMpLe
   (>= 0.03-18),rkward (>= 0.5.6)\cr Enhances: \tab
   rkward\cr Encoding: \tab UTF-8\cr License: \tab GPL (>=
   3)\cr LazyLoad: \tab yes\cr URL: \tab

Modified: trunk/rkward/packages/rkwarddev/man/tf.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/tf.Rd	2013-06-24 11:50:22 UTC (rev 4758)
+++ trunk/rkward/packages/rkwarddev/man/tf.Rd	2013-07-05 14:14:16 UTC (rev 4759)
@@ -20,12 +20,12 @@
   checkbox. In other words, set this to \code{TRUE} if you
   want the option to be set if the box is not checked.}
 
-  \item{ifelse}{Logical, whether the options should be
-  set anyway. By default, the option will only be set in
-  one condition. If \code{ifelse=TRUE}, it will get the
-  inverse value in case of the alternative condition, e.g.
-  it will be set to either \code{not=TRUE} or
-  \code{not=FALSE} if the box is checked or unchecked.}
+  \item{ifelse}{Logical, whether the options should be set
+  anyway. By default, the option will only be set in one
+  condition. If \code{ifelse=TRUE}, it will get the inverse
+  value in case of the alternative condition, e.g. it will
+  be set to either \code{not=TRUE} or \code{not=FALSE} if
+  the box is checked or unchecked.}
 
   \item{false}{Logical or character, the value the option
   should, only used get if \code{ifelse=TRUE} as well.





More information about the rkward-tracker mailing list