[rkward-cvs] SF.net SVN: rkward:[3918] trunk/rkward/packages/rkwarddev
m-eik at users.sourceforge.net
m-eik at users.sourceforge.net
Mon Oct 10 14:33:04 UTC 2011
Revision: 3918
http://rkward.svn.sourceforge.net/rkward/?rev=3918&view=rev
Author: m-eik
Date: 2011-10-10 14:33:03 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
rkwarddev: bugfixes in internal functions and rk.XML.pluginmap(), new functions rk.XML.code() rk.XML.help() (as of now only of internal use) and "..." option now also for rk.XML.menu()
Modified Paths:
--------------
trunk/rkward/packages/rkwarddev/ChangeLog
trunk/rkward/packages/rkwarddev/DESCRIPTION
trunk/rkward/packages/rkwarddev/NAMESPACE
trunk/rkward/packages/rkwarddev/R/rk-internal.R
trunk/rkward/packages/rkwarddev/R/rk.XML.menu.R
trunk/rkward/packages/rkwarddev/R/rk.XML.plugin.R
trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.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/man/rk.XML.menu.Rd
trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
Added Paths:
-----------
trunk/rkward/packages/rkwarddev/R/rk.XML.code.R
trunk/rkward/packages/rkwarddev/R/rk.XML.help.R
trunk/rkward/packages/rkwarddev/man/rk.XML.code.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.help.Rd
Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/ChangeLog 2011-10-10 14:33:03 UTC (rev 3918)
@@ -1,5 +1,12 @@
ChangeLog for package rkwarddev
+## 0.03-4 (2011-10-10)
+ - added functions rk.XML.code() and rk.XML.help()
+ - fixed bug in internal function check.ID() (produced false entry nodes under certain circumstances)
+ - fixed bug in rk.XML.pluginmap() for automatic component IDs
+ - cleaned up rk.XML.pluginmap() and rk.XML.plugin() hint code
+ - changed "nodes" option to "..." also in rk.XML.menu()
+
## 0.03-3 (2011-10-09)
- replaced most of the "nodes" and "children" options with "..." in functions rk.rkh.related(), rk.rkh.settings(),
rk.XML.col(), rk.XML.components(), rk.XML.context(), rk.XML.dialog(), rk.XML.frame(), rk.XML.hierarchy(), rk.XML.logic(),
Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION 2011-10-10 14:33:03 UTC (rev 3918)
@@ -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.03-3
-Date: 2011-10-09
+Version: 0.03-4
+Date: 2011-10-10
Collate:
'echo.R'
'id.R'
@@ -53,6 +53,7 @@
'rk.XML.attribute.R'
'rk.XML.browser.R'
'rk.XML.cbox.R'
+ 'rk.XML.code.R'
'rk.XML.col.R'
'rk.XML.component.R'
'rk.XML.components.R'
@@ -67,6 +68,7 @@
'rk.XML.external.R'
'rk.XML.formula.R'
'rk.XML.frame.R'
+ 'rk.XML.help.R'
'rk.XML.hierarchy.R'
'rk.XML.include.R'
'rk.XML.input.R'
Modified: trunk/rkward/packages/rkwarddev/NAMESPACE
===================================================================
--- trunk/rkward/packages/rkwarddev/NAMESPACE 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/NAMESPACE 2011-10-10 14:33:03 UTC (rev 3918)
@@ -32,6 +32,7 @@
export(rk.XML.attribute)
export(rk.XML.browser)
export(rk.XML.cbox)
+export(rk.XML.code)
export(rk.XML.col)
export(rk.XML.component)
export(rk.XML.components)
@@ -46,6 +47,7 @@
export(rk.XML.external)
export(rk.XML.formula)
export(rk.XML.frame)
+export(rk.XML.help)
export(rk.XML.hierarchy)
export(rk.XML.include)
export(rk.XML.input)
Modified: trunk/rkward/packages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk-internal.R 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/R/rk-internal.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -290,6 +290,8 @@
warning("ID is NULL!")
} else {}
+ names(node.ID) <- NULL
+
return(node.ID)
} ## end function check.ID()
Added: trunk/rkward/packages/rkwarddev/R/rk.XML.code.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.code.R (rev 0)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.code.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -0,0 +1,19 @@
+#' Create XML node "code" for RKWard plugins
+#'
+#' @param file A character string, the JavaScript file name to be included.
+#' @return An object of class \code{XiMpLe.node}.
+#' @export
+#' @seealso
+#' \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
+#' @examples
+#' test.code <- rk.XML.code("some_file.js")
+#' cat(pasteXMLNode(test.code))
+
+rk.XML.code <- function(file){
+ node <- new("XiMpLe.node",
+ name="code",
+ attributes=list(file=as.character(file))
+ )
+
+ return(node)
+}
Added: trunk/rkward/packages/rkwarddev/R/rk.XML.help.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.help.R (rev 0)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.help.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -0,0 +1,19 @@
+#' Create XML node "help" for RKWard plugins
+#'
+#' @param file A character string, the file name to be included as reference.
+#' @return An object of class \code{XiMpLe.node}.
+#' @export
+#' @seealso
+#' \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
+#' @examples
+#' test.help <- rk.XML.help("some_file.rkh")
+#' cat(pasteXMLNode(test.help))
+
+rk.XML.help <- function(file){
+ node <- new("XiMpLe.node",
+ name="help",
+ attributes=list(file=as.character(file))
+ )
+
+ return(node)
+}
Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.menu.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.menu.R 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.menu.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -4,7 +4,7 @@
#' Use same \code{id} values to place entries in the same menu.
#'
#' @param label Character string, a label for the menu.
-#' @param nodes A (list of) objects of class \code{XiMpLe.node}, must be either
+#' @param ... Objects of class \code{XiMpLe.node}, must be either
#' "menu" or "entry".
#' @param index Integer number to influence the level of menu placement.
#' @param id.name Character string, a unique ID for this plugin element.
@@ -21,10 +21,12 @@
#' @examples
#' test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
#' test.entry <- rk.XML.entry(test.component)
-#' test.menu <- rk.XML.menu("Analysis", nodes=test.entry, id.name="analysis")
+#' test.menu <- rk.XML.menu("Analysis", test.entry, id.name="analysis")
#' cat(pasteXMLNode(test.menu))
-rk.XML.menu <- function(label, nodes, index=-1, id.name="auto"){
+rk.XML.menu <- function(label, ..., index=-1, id.name="auto"){
+ nodes <- list(...)
+
# check the node names and allow only valid ones
sapply(child.list(nodes), function(this.node){
stopifnot(inherits(this.node, "XiMpLe.node"))
Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.plugin.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.plugin.R 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.plugin.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -42,23 +42,14 @@
name <- clean.name(name)
} else {}
- all.children <- list(new("XiMpLe.node",
- name="code",
- attributes=list(file=paste(name, ".js", sep=""))
- ))
+ all.children <- list(rk.XML.code(file=paste(name, ".js", sep="")))
if(isTRUE(help)){
- all.children[[length(all.children)+1]] <- new("XiMpLe.node",
- name="help",
- attributes=list(file=paste(name, ".rkh", sep=""))
- )
+ all.children[[length(all.children)+1]] <- rk.XML.help(file=paste(name, ".rkh", sep=""))
} else {}
if(!is.null(pluginmap)){
- all.children[[length(all.children)+1]] <- new("XiMpLe.node",
- name="include",
- attributes=list(file=pluginmap)
- )
+ all.children[[length(all.children)+1]] <- rk.XML.include(file=pluginmap)
} else {}
if(!is.null(snippets)){
@@ -80,10 +71,10 @@
new("XiMpLe.node",
# add these as comments because they need editing
name="!--",
- value="<convert id=\"!edit!\", mode=\"!edit!\", sources=\"!edit!\", standard=\"!edit!\" />"),
+ children=list(rk.XML.convert(sources="!edit!", mode=c(equals="!edit!"), id.name="!edit!"))),
new("XiMpLe.node",
name="!--",
- value="<connect client=\"!edit!\", governor=\"!edit!\" />")
+ children=list(rk.XML.connect(governor="!edit!", client="!edit!")))
)
all.children[[length(all.children)+1]] <- new("XiMpLe.node",
name="logic",
@@ -105,10 +96,7 @@
if(is.null(dialog)){
if("dialog" %in% provides){
- all.children[[length(all.children)+1]] <- new("XiMpLe.node",
- name="dialog",
- attributes=list(label=label),
- value="")
+ all.children[[length(all.children)+1]] <- rk.XML.dialog(label=label)
} else {}
} else {
# check if this is *really* a dialog section
@@ -126,15 +114,8 @@
if(is.null(wizard)){
if("wizard" %in% provides){
# create a first page for the wizard section
- plugin.wizard.page <- new("XiMpLe.node",
- name="page",
- attributes=list(label=label),
- value="")
- plugin.wizard <- new("XiMpLe.node",
- name="wizard",
- attributes=list(label=label),
- children=child.list(plugin.wizard.page),
- value="")
+ plugin.wizard.page <- rk.XML.page(id.name=auto.ids(label, prefix=ID.prefix("page")))
+ plugin.wizard <- rk.XML.wizard(plugin.wizard.page, label=label)
all.children[[length(all.children)+1]] <- plugin.wizard
} else {}
} else {
Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.R 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -66,7 +66,7 @@
if(isTRUE(hints)){
about.XML <- new("XiMpLe.node",
name="!--",
- value="<about></about>")
+ children=list(new("XiMpLe.node", name="about", value="")))
# initialize all.children list
all.children <- list(about.XML)
} else {
@@ -98,7 +98,7 @@
if(isTRUE(hints)){
require.XML <- new("XiMpLe.node",
name="!--",
- value="<require file=\"path/file.pluginmap\" />")
+ children=list(rk.XML.require("path/file.pluginmap")))
all.children[[length(all.children)+1]] <- require.XML
} else {}
}
@@ -117,7 +117,7 @@
components.XML <- rk.XML.components(
as.list(sapply(components, function(this.comp){
# remove any directory names and .EXT endings
- xml.basename <- gsub("(.*/)?([[:alnum:]]*).+(.*)?", "\\2", this.comp, perl=TRUE)
+ xml.basename <- gsub("(.*/)?([[:alnum:]_]*).+(.*)?", "\\2", this.comp, perl=TRUE)
rk.XML.component(
label=xml.basename,
file=this.comp,
@@ -154,18 +154,18 @@
entry.XML <- rk.XML.menu(
label=name.orig,
- nodes=rk.XML.entry(component=this.comp),
+ rk.XML.entry(component=this.comp),
id.name=auto.ids(paste(name, this.comp, sep=""), prefix=ID.prefix("menu"), chars=12))
if(this.hier %in% names(main.menu)){
hier.XML <- rk.XML.menu(
label=main.menu[this.hier],
- nodes=entry.XML,
+ entry.XML,
id.name=this.hier)
} else {
hier.XML <- rk.XML.menu(
label="Test",
- nodes=entry.XML,
+ entry.XML,
id.name="test")
}
return(hier.XML)
@@ -191,7 +191,7 @@
if(isTRUE(hints)){
context.x11.XML <- new("XiMpLe.node",
name="!--",
- value="<context id=\"x11\"></context>")
+ children=list(rk.XML.context(id="x11")))
all.children[[length(all.children)+1]] <- context.x11.XML
} else {}
}
@@ -213,7 +213,7 @@
if(isTRUE(hints)){
context.import.XML <- new("XiMpLe.node",
name="!--",
- value="<context id=\"import\"></context>")
+ children=list(rk.XML.context(id="import")))
all.children[[length(all.children)+1]] <- context.import.XML
} else {}
}
Modified: trunk/rkward/packages/rkwarddev/R/rk.rkh.doc.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.rkh.doc.R 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/R/rk.rkh.doc.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -58,18 +58,6 @@
all.children[[length(all.children)+1]] <- summary
}
-# rkh.summary <- new("XiMpLe.node",
-# name="summary")
-# if(is.null(summary)){
-# rkh.summary at value <- ""
-# } else if(is.list(summary)){
-# rkh.summary at children <- summary
-# } else if(inherits(summary, "XiMpLe.node")){
-# rkh.summary at children <- list(summary)
-# } else {
-# rkh.summary at value <- summary
-# }
-
if(is.null(usage)){
all.children[[length(all.children)+1]] <- rk.rkh.usage()
} else {
@@ -85,18 +73,6 @@
all.children[[length(all.children)+1]] <- usage
}
-# rkh.usage <- new("XiMpLe.node",
-# name="usage")
-# if(is.null(usage)){
-# rkh.usage at value <- ""
-# } else if(is.list(usage)){
-# rkh.usage at children <- usage
-# } else if(inherits(usage, "XiMpLe.node")){
-# rkh.usage at children <- list(usage)
-# } else {
-# rkh.usage at value <- usage
-# }
-
if(is.null(sections)){
all.children[[length(all.children)+1]] <- new("XiMpLe.node",
name="!--",
@@ -132,18 +108,6 @@
all.children[[length(all.children)+1]] <- settings
}
-# rkh.settings <- new("XiMpLe.node",
-# name="settings")
-# if(is.null(settings)){
-# rkh.settings at value <- ""
-# } else if(is.list(settings)){
-# rkh.settings at children <- settings
-# } else if(inherits(settings, "XiMpLe.node")){
-# rkh.settings at children <- list(settings)
-# } else {
-# rkh.settings at value <- settings
-# }
-
if(is.null(related)){
all.children[[length(all.children)+1]] <- new("XiMpLe.node",
name="!--",
@@ -161,20 +125,6 @@
all.children[[length(all.children)+1]] <- related
}
-# rkh.related <- new("XiMpLe.node",
-# name="related")
-# if(is.null(related)){
-# rkh.related at children <- list(new("XiMpLe.node",
-# name="!--",
-# value="<ul><li><link href=\"rkward://rhelp/...\"/></li></ul>"))
-# } else if(is.list(related)){
-# rkh.related at children <- related
-# } else if(inherits(related, "XiMpLe.node")){
-# rkh.related at children <- list(related)
-# } else {
-# rkh.related at value <- related
-# }
-
if(is.null(technical)){
all.children[[length(all.children)+1]] <- rk.rkh.technical()
} else {
@@ -190,18 +140,6 @@
all.children[[length(all.children)+1]] <- technical
}
-# rkh.technical <- new("XiMpLe.node",
-# name="technical")
-# if(is.null(technical)){
-# rkh.technical at value <- ""
-# } else if(is.list(technical)){
-# rkh.technical at children <- technical
-# } else if(inherits(technical, "XiMpLe.node")){
-# rkh.technical at children <- list(technical)
-# } else {
-# rkh.technical at value <- technical
-# }
-
rkh.document <- new("XiMpLe.node",
name="document",
children=all.children,
Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R 2011-10-10 14:33:03 UTC (rev 3918)
@@ -3,8 +3,8 @@
#' \tabular{ll}{
#' Package: \tab rkwarddev\cr
#' Type: \tab Package\cr
-#' Version: \tab 0.03-3\cr
-#' Date: \tab 2011-10-09\cr
+#' Version: \tab 0.03-4\cr
+#' Date: \tab 2011-10-10\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-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/inst/CITATION 2011-10-10 14:33:03 UTC (rev 3918)
@@ -2,12 +2,12 @@
title="rkwarddev: A collection of tools for RKWard plugin development",
author="Meik Michalke",
year="2011",
- note="(Version 0.03-3)",
+ note="(Version 0.03-4)",
url="http://rkward.sourceforge.net",
textVersion =
paste("Michalke, M. (2011). ",
- "rkwarddev: A collection of tools for RKWard plugin development (Version 0.03-3). ",
+ "rkwarddev: A collection of tools for RKWard plugin development (Version 0.03-4). ",
"Available from http://rkward.sourceforge.net",
sep=""),
Added: trunk/rkward/packages/rkwarddev/man/rk.XML.code.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.code.Rd (rev 0)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.code.Rd 2011-10-10 14:33:03 UTC (rev 3918)
@@ -0,0 +1,25 @@
+\name{rk.XML.code}
+\alias{rk.XML.code}
+\title{Create XML node "code" for RKWard plugins}
+\usage{
+ rk.XML.code(file)
+}
+\arguments{
+ \item{file}{A character string, the JavaScript file name
+ to be included.}
+}
+\value{
+ An object of class \code{XiMpLe.node}.
+}
+\description{
+ Create XML node "code" for RKWard plugins
+}
+\examples{
+test.code <- rk.XML.code("some_file.js")
+cat(pasteXMLNode(test.code))
+}
+\seealso{
+ \href{help:rkwardplugins}{Introduction to Writing Plugins
+ for RKWard}
+}
+
Added: trunk/rkward/packages/rkwarddev/man/rk.XML.help.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.help.Rd (rev 0)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.help.Rd 2011-10-10 14:33:03 UTC (rev 3918)
@@ -0,0 +1,25 @@
+\name{rk.XML.help}
+\alias{rk.XML.help}
+\title{Create XML node "help" for RKWard plugins}
+\usage{
+ rk.XML.help(file)
+}
+\arguments{
+ \item{file}{A character string, the file name to be
+ included as reference.}
+}
+\value{
+ An object of class \code{XiMpLe.node}.
+}
+\description{
+ Create XML node "help" for RKWard plugins
+}
+\examples{
+test.help <- rk.XML.help("some_file.rkh")
+cat(pasteXMLNode(test.help))
+}
+\seealso{
+ \href{help:rkwardplugins}{Introduction to Writing Plugins
+ for RKWard}
+}
+
Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.menu.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.menu.Rd 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.menu.Rd 2011-10-10 14:33:03 UTC (rev 3918)
@@ -2,13 +2,13 @@
\alias{rk.XML.menu}
\title{Create XML "menu" node for RKWard plugins}
\usage{
- rk.XML.menu(label, nodes, index = -1, id.name = "auto")
+ rk.XML.menu(label, ..., index = -1, id.name = "auto")
}
\arguments{
\item{label}{Character string, a label for the menu.}
- \item{nodes}{A (list of) objects of class
- \code{XiMpLe.node}, must be either "menu" or "entry".}
+ \item{...}{Objects of class \code{XiMpLe.node}, must be
+ either "menu" or "entry".}
\item{index}{Integer number to influence the level of
menu placement.}
@@ -29,7 +29,7 @@
\examples{
test.component <- rk.XML.component("My GUI dialog", "plugins/MyGUIdialog.xml")
test.entry <- rk.XML.entry(test.component)
-test.menu <- rk.XML.menu("Analysis", nodes=test.entry, id.name="analysis")
+test.menu <- rk.XML.menu("Analysis", test.entry, id.name="analysis")
cat(pasteXMLNode(test.menu))
}
\seealso{
Modified: trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd 2011-10-09 20:38:53 UTC (rev 3917)
+++ trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd 2011-10-10 14:33:03 UTC (rev 3918)
@@ -8,8 +8,8 @@
}
\details{
\tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
- Package\cr Version: \tab 0.03-3\cr Date: \tab
- 2011-10-09\cr Depends: \tab R (>= 2.9.0),XiMpLe,rkward
+ Package\cr Version: \tab 0.03-4\cr Date: \tab
+ 2011-10-10\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