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

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Tue Nov 8 23:29:52 UTC 2011


Revision: 4025
          http://rkward.svn.sourceforge.net/rkward/?rev=4025&view=rev
Author:   m-eik
Date:     2011-11-08 23:29:51 +0000 (Tue, 08 Nov 2011)
Log Message:
-----------
rkwarddev: improvements in scanning checkable frames, long description support

Modified Paths:
--------------
    trunk/rkward/packages/rkwarddev/ChangeLog
    trunk/rkward/packages/rkwarddev/DESCRIPTION
    trunk/rkward/packages/rkwarddev/R/rk-internal.R
    trunk/rkward/packages/rkwarddev/R/rk.JS.scan.R
    trunk/rkward/packages/rkwarddev/R/rk.XML.about.R
    trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R
    trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R
    trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/packages/rkwarddev/inst/CITATION
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
    trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd
    trunk/rkward/packages/rkwarddev/man/rk.XML.frame.Rd
    trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd

Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/ChangeLog	2011-11-08 23:29:51 UTC (rev 4025)
@@ -1,6 +1,10 @@
 ChangeLog for package rkwarddev
 
+## 0.04-7 (2011-11-08)
+  - added long description support to rk.XML.about(), used for the DESCRIPTION file
+
 ## 0.04-6 (2011-10-31)
+  - added <frame> to the tags which are scanned by rk.JS.scan(), they're considered only if checkable
   - improved output of rk.JS.var class objects by rk.paste.JS()
 
 ## 0.04-5 (2011-10-28)

Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION	2011-11-08 23:29:51 UTC (rev 4025)
@@ -14,8 +14,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.04-6
-Date: 2011-10-31
+Version: 0.04-7
+Date: 2011-11-08
 Collate:
     'echo.R'
     'id.R'

Modified: trunk/rkward/packages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk-internal.R	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/R/rk-internal.R	2011-11-08 23:29:51 UTC (rev 4025)
@@ -83,7 +83,7 @@
 # scans XML tags for defined IDs, returns a matrix with columns "id" and "abbrev",
 # and optional "tag"
 # 'single.tags' can also contain XiMpLe.node objects
-get.IDs <- function(single.tags, relevant.tags, add.abbrev=FALSE, tag.names=FALSE){
+get.IDs <- function(single.tags, relevant.tags, add.abbrev=FALSE, tag.names=FALSE, only.checkable=FALSE){
 
 	# filter for relevant tags
 	cleaned.tags <- list()
@@ -91,14 +91,30 @@
 		if(inherits(this.tag, "XiMpLe.node")){
 			this.tag.name <- this.tag at name
 			if(this.tag.name %in% relevant.tags & "id" %in% names(this.tag at attributes)){
-				cleaned.tags[length(cleaned.tags)+1] <- this.tag
+				if(isTRUE(only.checkable) & this.tag.name %in% "frame"){
+					if("checkable" %in% names(this.tag at attributes)){
+						if(identical(this.tag at attributes[["checkable"]], "true")){
+							cleaned.tags[length(cleaned.tags)+1] <- this.tag
+						} else {}
+					} else {}
+				} else {
+					cleaned.tags[length(cleaned.tags)+1] <- this.tag
+				}
 			} else {}
 		} else {
 			this.tag.name <- tolower(XiMpLe:::XML.tagName(this.tag))
 			# we're only interested in entries with an ID
 			if(this.tag.name %in% relevant.tags){
 				if("id" %in% names(XiMpLe:::parseXMLAttr(this.tag))){
-					cleaned.tags[length(cleaned.tags)+1] <- this.tag
+					if(isTRUE(only.checkable) & this.tag.name %in% "frame"){
+						if("checkable" %in% names(XiMpLe:::parseXMLAttr(this.tag))){
+							if(identical(XiMpLe:::parseXMLAttr(this.tag)[["checkable"]], "true")){
+								cleaned.tags[length(cleaned.tags)+1] <- this.tag
+							} else {}
+						} else {}
+					} else {
+						cleaned.tags[length(cleaned.tags)+1] <- this.tag
+					}
 				} else {}
 			} else {}
 		}

Modified: trunk/rkward/packages/rkwarddev/R/rk.JS.scan.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.JS.scan.R	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/R/rk.JS.scan.R	2011-11-08 23:29:51 UTC (rev 4025)
@@ -15,7 +15,7 @@
 
 	JS.relevant.tags <- c("radio", "varslot", "browser", "dropdown",
 		"checkbox", "saveobject", "input", "spinbox")
-
+	
 	single.tags <- get.single.tags(XML.obj=pXML, drop=c("comments","cdata", "declarations", "doctype"))
 
 	JS.id <- get.IDs(single.tags=single.tags, relevant.tags=JS.relevant.tags, add.abbrev=add.abbrev)
@@ -40,5 +40,23 @@
 		JS.lines <- NULL
 	}
 
+	# special tags: must be chackable and get "checked" property
+	JS.special.tags <- c("frame")
+	JS.special.id <- get.IDs(single.tags=single.tags, relevant.tags=JS.special.tags, add.abbrev=add.abbrev, only.checkable=TRUE)
+	if("id" %in% colnames(JS.special.id)){
+		if(isTRUE(js)){
+			JS.lines <- paste(JS.lines, paste(unlist(sapply(1:nrow(JS.special.id), function(this.id){
+					return(rk.paste.JS(get.JS.vars(
+						JS.var=JS.special.id[this.id,"abbrev"],
+						XML.var=JS.special.id[this.id,"id"],
+						modifiers="checked"),
+						level=2, indent.by=indent.by))
+				})), collapse=""))
+		} else {
+			JS.lines <- c(JS.lines, JS.special.id[,"id"])
+			names(JS.lines) <- NULL
+		}
+	} else {}
+
 	return(JS.lines)
 }

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.about.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.about.R	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.about.R	2011-11-08 23:29:51 UTC (rev 4025)
@@ -17,6 +17,7 @@
 #'			\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{long.desc}{A long description (optional, defaults to \code{desc})}
 #'		}
 #' @param dependencies A named list with these elements:
 #'		\describe{
@@ -71,7 +72,7 @@
 #' cat(pasteXMLNode(about.node, shine=2))
 
 
-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){
+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)", long.desc=NULL), dependencies=NULL, package=NULL, pluginmap=NULL){
 	# sanity checks
 	stopifnot(all(length(name), length(author)) > 0)
 	if(is.null(about)){
@@ -92,6 +93,9 @@
 	if(!"license" %in% names(about)){
 		about[["license"]] <- "GPL (>= 3)"
 	} else {}
+	if(!"long.desc" %in% names(about) | is.null(about[["long.desc"]])){
+		about[["long.desc"]] <- about[["desc"]]
+	} else {}
 
 	## author
 	# - given
@@ -248,6 +252,7 @@
 				attributes=list(
 					name=name,
 					"shortinfo"=about[["desc"]],
+					"longinfo"=about[["long.desc"]],
 					version=about[["version"]],
 					"releasedate"=about[["date"]],
 					url=about[["url"]],

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R	2011-11-08 23:29:51 UTC (rev 4025)
@@ -18,7 +18,7 @@
 #'   "Second Option"=c(val="val2", chk=TRUE)))
 #' cat(pasteXMLNode(rk.XML.frame(test.dropdown, label="Some options")))
 
-rk.XML.frame <- function(..., label=NULL, checkable=FALSE, chk=FALSE, id.name="auto"){
+rk.XML.frame <- function(..., label=NULL, checkable=FALSE, chk=TRUE, id.name="auto"){
 	nodes <- list(...)
 
 	if(!is.null(label)){
@@ -29,12 +29,10 @@
 
 	if(isTRUE(checkable)){
 		attr.list[["checkable"]] <- "true"
-		if(isTRUE(chk)){
-			attr.list[["checked"]] <- "true"
+		if(!isTRUE(chk)){
+			attr.list[["checked"]] <- "false"
 		} else {}
-	} else {
-		attr.list[["checkable"]] <- "false"
-	}
+	} else {}
 
 	if(identical(id.name, "auto")){
 		if(!is.null(label)){

Modified: trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R	2011-11-08 23:29:51 UTC (rev 4025)
@@ -329,7 +329,7 @@
 			desc <- data.frame(
 				Package=name,
 				Type="Package",
-				Title=about.node at attributes[["name"]],
+				Title=about.node at attributes[["shortinfo"]],
 				Version=about.node at attributes[["version"]],
 				Date=about.node at attributes[["releasedate"]],
 				Author=all.authors,
@@ -338,7 +338,7 @@
 				Depends=XML2dependencies(about.node, suggest=suggest.required, mode="depends"),
 				Suggests=XML2dependencies(about.node, suggest=suggest.required, mode="suggest"),
 				Enhances="rkward",
-				Description=about.node at attributes[["shortinfo"]],
+				Description=about.node at attributes[["longinfo"]],
 				License=about.node at attributes[["license"]],
 #				Encoding="UTF-8",
 				LazyLoad=ifelse(isTRUE(lazyLoad), "yes", "no"),

Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2011-11-08 23:29:51 UTC (rev 4025)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.04-6\cr
-#' Date: \tab 2011-10-31\cr
+#' Version: \tab 0.04-7\cr
+#' Date: \tab 2011-11-08\cr
 #' Depends: \tab R (>= 2.9.0),XiMpLe,rkward (>= 0.5.6)\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr

Modified: trunk/rkward/packages/rkwarddev/inst/CITATION
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/CITATION	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/inst/CITATION	2011-11-08 23:29:51 UTC (rev 4025)
@@ -2,12 +2,12 @@
 		title="rkwarddev: A collection of tools for RKWard plugin development",
 		author="Meik Michalke",
 		year="2011",
-		note="(Version 0.04-6)",
+		note="(Version 0.04-7)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2011). ",
-				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.04-6). ",
+				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.04-7). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
===================================================================
(Binary files differ)

Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd	2011-11-08 23:29:51 UTC (rev 4025)
@@ -5,8 +5,8 @@
   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)
+  (>= 3)", long.desc = NULL), dependencies = NULL, package
+  = NULL, pluginmap = NULL)
 }
 \arguments{
   \item{name}{A character string with the plugin name.}
@@ -27,7 +27,8 @@
   \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)} }}
+  category for this plugin (optional)} \item{long.desc}{A
+  long description (optional, defaults to \code{desc})} }}
 
   \item{dependencies}{A named list with these elements:
   \describe{ \item{rkward.min}{Minimum RKWard version

Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.frame.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.frame.Rd	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.frame.Rd	2011-11-08 23:29:51 UTC (rev 4025)
@@ -3,7 +3,7 @@
 \title{Create XML node "column" for RKWard plugins}
 \usage{
   rk.XML.frame(..., label = NULL, checkable = FALSE, chk =
-  FALSE, id.name = "auto")
+  TRUE, id.name = "auto")
 }
 \arguments{
   \item{...}{Objects of class \code{XiMpLe.node}.}

Modified: trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2011-11-08 20:32:31 UTC (rev 4024)
+++ trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2011-11-08 23:29:51 UTC (rev 4025)
@@ -8,8 +8,8 @@
 }
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
-  Package\cr Version: \tab 0.04-6\cr Date: \tab
-  2011-10-31\cr Depends: \tab R (>= 2.9.0),XiMpLe,rkward
+  Package\cr Version: \tab 0.04-7\cr Date: \tab
+  2011-11-08\cr Depends: \tab R (>= 2.9.0),XiMpLe,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 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