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

m-eik at users.sf.net m-eik at users.sf.net
Mon Oct 6 19:56:58 UTC 2014


Revision: 4881
          http://sourceforge.net/p/rkward/code/4881
Author:   m-eik
Date:     2014-10-06 19:56:54 +0000 (Mon, 06 Oct 2014)
Log Message:
-----------
rkwarddev: some fixes for automatic scanning of plugin code

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.scan.R
    trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
    trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd

Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog	2014-10-06 19:22:06 UTC (rev 4880)
+++ trunk/rkward/packages/rkwarddev/ChangeLog	2014-10-06 19:56:54 UTC (rev 4881)
@@ -1,8 +1,10 @@
 ChangeLog for package rkwarddev
 
-changes in version 0.06-5 (2014-10-04)
+changes in version 0.06-5 (2014-10-06)
 fixed:
   - the "show" feature in rk.plugin.skeleton() was broken due to changes in the namespace defaults
+  - scanning plugin XML code for JS and help related content didn't work as expected in rk.plugin.component()
+  - rk.rkh.scan() now also recognises <optioncolumn> and <matrix> nodes
 
 changes in version 0.06-4 (2014-09-14)
 added:

Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION	2014-10-06 19:22:06 UTC (rev 4880)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION	2014-10-06 19:56:54 UTC (rev 4881)
@@ -15,7 +15,7 @@
 Authors at R: c(person(given="Meik", family="Michalke",
     email="meik.michalke at hhu.de", role=c("aut", "cre")))
 Version: 0.06-5
-Date: 2014-10-04
+Date: 2014-10-06
 Collate:
     'echo.R'
     'i18n.R'

Modified: trunk/rkward/packages/rkwarddev/R/rk.plugin.component.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.plugin.component.R	2014-10-06 19:22:06 UTC (rev 4880)
+++ trunk/rkward/packages/rkwarddev/R/rk.plugin.component.R	2014-10-06 19:56:54 UTC (rev 4881)
@@ -154,17 +154,8 @@
   }
 
   ## create plugin.js
-  if("js" %in% create & length(js) > 0){
-    got.JS.options <- names(js)
-    for (this.opt in c("require", "globals", "variables", "preprocess", "calculate", "printout", "doPrintout", "load.silencer")){
-      if(!this.opt %in% got.JS.options) {
-        js[[this.opt]] <- eval(formals(rk.JS.doc)[[this.opt]])
-      } else {}
-    }
-    if(!"results.header" %in% got.JS.options) {
-      js[["results.header"]] <- paste0("\"", name.orig, " results\"")
-    } else {}
-    if("var" %in% scan){
+  js.try.scan <- function(XML.plugin, scan, js, guess.getter){
+      if("var" %in% scan){
       var.scanned <- rk.JS.scan(XML.plugin, guess.getter=guess.getter)
       if(!is.null(var.scanned)){
         js[["variables"]] <- paste0(
@@ -178,6 +169,19 @@
         js[["printout"]] <- paste(js[["printout"]], saveobj.scanned, sep="\n")
       } else {}
     } else {}
+    return(js)
+  }
+  if("js" %in% create & length(js) > 0){
+    got.JS.options <- names(js)
+    for (this.opt in c("require", "globals", "variables", "preprocess", "calculate", "printout", "doPrintout", "load.silencer")){
+      if(!this.opt %in% got.JS.options) {
+        js[[this.opt]] <- eval(formals(rk.JS.doc)[[this.opt]])
+      } else {}
+    }
+    if(!"results.header" %in% got.JS.options) {
+      js[["results.header"]] <- paste0("\"", name.orig, " results\"")
+    } else {}
+    js <- js.try.scan(XML.plugin=XML.plugin, scan=scan, js=js, guess.getter=guess.getter)
     JS.code <- rk.JS.doc(
       require=js[["require"]],
       variables=js[["variables"]],
@@ -192,7 +196,10 @@
       indent.by=indent.by)
     slot(this.component, "js") <- JS.code
   } else {
-    slot(this.component, "js") <- rk.JS.doc()
+    if("js" %in% create){
+      js <- js.try.scan(XML.plugin=XML.plugin, scan=scan, js=js, guess.getter=guess.getter)
+    } else {}
+    slot(this.component, "js") <- rk.JS.doc(variables=js[["variables"]], printout=js[["printout"]])
   }
 
   ## create plugin.rkh
@@ -223,7 +230,10 @@
       gen.info=gen.info)
     slot(this.component, "rkh") <- rkh.doc
   } else {
-    slot(this.component, "rkh") <- rk.rkh.doc(hints=hints)
+    if("rkh" %in% create & "settings" %in% scan){
+      rkh[["settings"]] <- rk.rkh.settings(rk.rkh.scan(XML.plugin))
+    } else {}
+    slot(this.component, "rkh") <- rk.rkh.doc(settings=rkh[["settings"]], hints=hints)
   }
 
   return(this.component)

Modified: trunk/rkward/packages/rkwarddev/R/rk.rkh.scan.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.rkh.scan.R	2014-10-06 19:22:06 UTC (rev 4880)
+++ trunk/rkward/packages/rkwarddev/R/rk.rkh.scan.R	2014-10-06 19:56:54 UTC (rev 4881)
@@ -29,7 +29,7 @@
 rk.rkh.scan <- function(pXML, help=TRUE, captions=TRUE){
 
   settings.tags <- c("radio", "varslot", "browser", "dropdown",
-    "checkbox", "saveobject", "input", "spinbox")
+    "checkbox", "saveobject", "input", "spinbox", "optioncolumn", "matrix")
   if(isTRUE(captions)){
     caption.tags <- c("page", "tab", "frame")
   } else {

Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2014-10-06 19:22:06 UTC (rev 4880)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2014-10-06 19:56:54 UTC (rev 4881)
@@ -4,7 +4,7 @@
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
 #' Version: \tab 0.06-5\cr
-#' Date: \tab 2014-10-04\cr
+#' Date: \tab 2014-10-06\cr
 #' Depends: \tab R (>= 2.9.0),methods,XiMpLe (>= 0.03-21),rkward (>= 0.5.7)\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr

Modified: trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/NEWS.Rd	2014-10-06 19:22:06 UTC (rev 4880)
+++ trunk/rkward/packages/rkwarddev/inst/NEWS.Rd	2014-10-06 19:56:54 UTC (rev 4881)
@@ -1,10 +1,11 @@
 \name{NEWS}
 \title{News for Package 'rkwarddev'}
 \encoding{UTF-8}
-\section{Changes in rkwarddev version 0.06-5 (2014-10-04)}{
+\section{Changes in rkwarddev version 0.06-5 (2014-10-06)}{
   \subsection{fixed}{
     \itemize{
       \item the \code{"show"} feature in \code{rk.plugin.skeleton()} was broken due to changes in the namespace defaults
+      \item scanning plugin XML code for JS and help related content didn't work as expected in \code{rk.plugin.component()}
     }
   }
 }

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

Modified: trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2014-10-06 19:22:06 UTC (rev 4880)
+++ trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2014-10-06 19:56:54 UTC (rev 4881)
@@ -11,7 +11,7 @@
 Package: \tab rkwarddev\cr
 Type: \tab Package\cr
 Version: \tab 0.06-5\cr
-Date: \tab 2014-10-04\cr
+Date: \tab 2014-10-06\cr
 Depends: \tab R (>= 2.9.0),methods,XiMpLe (>= 0.03-21),rkward (>= 0.5.7)\cr
 Enhances: \tab rkward\cr
 Encoding: \tab UTF-8\cr





More information about the rkward-tracker mailing list