[rkward-cvs] [rkward] packages/rkwarddev: added feature to require rkward::menu and rkward::embedded in pluginmaps. it's TRUE by default but will be set to FALSE if internal=TRUE is set in rk.plugin.skeleton().
m.eik michalke
meik.michalke at uni-duesseldorf.de
Wed Feb 4 13:52:18 UTC 2015
Git commit 1e1f99136bb4219f05c62b26769b54a7c029ae33 by m.eik michalke.
Committed on 04/02/2015 at 13:51.
Pushed by meikm into branch 'master'.
added feature to require rkward::menu and rkward::embedded in pluginmaps. it's TRUE by default but will be set to FALSE if internal=TRUE is set in rk.plugin.skeleton().
M +3 -1 packages/rkwarddev/ChangeLog
M +5 -4 packages/rkwarddev/DESCRIPTION
M +15 -2 packages/rkwarddev/R/rk.XML.pluginmap.R
M +9 -4 packages/rkwarddev/R/rk.plugin.skeleton.R
M +1 -1 packages/rkwarddev/R/rkwarddev-package.R
M +5 -1 packages/rkwarddev/inst/NEWS.Rd
M +6 -1 packages/rkwarddev/man/rk.XML.pluginmap.Rd
M +7 -3 packages/rkwarddev/man/rk.plugin.skeleton.Rd
M +1 -1 packages/rkwarddev/man/rkwarddev-package.Rd
http://commits.kde.org/rkward/1e1f99136bb4219f05c62b26769b54a7c029ae33
diff --git a/packages/rkwarddev/ChangeLog b/packages/rkwarddev/ChangeLog
index 78564bf..c37b580 100644
--- a/packages/rkwarddev/ChangeLog
+++ b/packages/rkwarddev/ChangeLog
@@ -1,6 +1,6 @@
ChangeLog for package rkwarddev
-changes in version 0.07-1 (2015-02-01)
+changes in version 0.07-1 (2015-02-04)
fixed:
- rk.XML.optionset() does now allow to re-use objects defined in the same
function call (i.e., refer to optioncolumns in the logic section)
@@ -29,6 +29,8 @@ added:
rk.XML.varslot().
- rk.XML.pluginmap() now adds a "po_id" attribute to pluginmaps, necessary
for i18n
+ - new attribute "require.defaults" in rk.XML.pluginmap() to add
+ rkward::menu and rkward::embedded as requirements
- new attribute "i18n" added to several XML functions; it takes a list with
the named arguments "comment" or "context" to either produce an i18n
comment node or an "i18n_context" attribute
diff --git a/packages/rkwarddev/DESCRIPTION b/packages/rkwarddev/DESCRIPTION
index e40d666..f470064 100644
--- a/packages/rkwarddev/DESCRIPTION
+++ b/packages/rkwarddev/DESCRIPTION
@@ -8,15 +8,16 @@ Depends:
Suggests:
testthat
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="m.eik", family="michalke", email="meik.michalke at hhu.de", role=c("aut", "cre")))
+Authors at R: c(person(given="m.eik", family="michalke",
+ email="meik.michalke at hhu.de", role=c("aut", "cre")))
Version: 0.07-1
-Date: 2015-02-01
+Date: 2015-02-04
Collate:
'00_class_01_rk.JS.arr.R'
'00_class_02_rk.JS.var.R'
diff --git a/packages/rkwarddev/R/rk.XML.pluginmap.R b/packages/rkwarddev/R/rk.XML.pluginmap.R
index e2307f7..a56da9f 100644
--- a/packages/rkwarddev/R/rk.XML.pluginmap.R
+++ b/packages/rkwarddev/R/rk.XML.pluginmap.R
@@ -51,13 +51,15 @@
#' @param priority Character string, the priority attribute of the \code{<document>} node. Must be either "hidden", "low", "medium", or "high",
#' defaults to "medium".
#' @param id.name Character string, a unique ID for this plugin element. If \code{"auto"}, an ID will be generated automatically from \code{name}.
+#' @param require.defaults Logical, if \code{TRUE}, \code{<require map="rkward::menu" />} and \code{<require map="rkward::embedded" />} will be added
+#' by default, which ensures that the menu structure and embeddable plugins are loaded. It shouldn't hurt to set this.
#' @seealso \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
#' @return An object of class \code{XiMpLe.node}.
#' @export
rk.XML.pluginmap <- function(name, about=NULL, components, hierarchy="test",
require=NULL, x11.context=NULL, import.context=NULL, clean.name=TRUE, hints=FALSE, gen.info=TRUE,
- dependencies=NULL, namespace=name, priority="medium", id.name="auto"){
+ dependencies=NULL, namespace=name, priority="medium", id.name="auto", require.defaults=TRUE){
name.orig <- name
if(isTRUE(clean.name)){
# to besure, remove all non-character symbols from name
@@ -109,6 +111,12 @@ rk.XML.pluginmap <- function(name, about=NULL, components, hierarchy="test",
} else {}
## require section
+ if(isTRUE(require.defaults)){
+ if(is.null(require)){
+
+ } else {
+ }
+ } else {}
if(!is.null(require)){
# check if this is *really* require nodes
for(this.child in child.list(require)){
@@ -124,11 +132,16 @@ rk.XML.pluginmap <- function(name, about=NULL, components, hierarchy="test",
}
}
} else {
- if(isTRUE(hints)){
+ if(!isTRUE(require.defaults) & isTRUE(hints)){
require.XML <- XMLNode("!--", rk.XML.require("path/file.pluginmap"))
all.children[[length(all.children)+1]] <- require.XML
} else {}
}
+ # check defaults
+ if(isTRUE(require.defaults)){
+ all.children[[length(all.children)+1]] <- rk.XML.require(map="rkward::menu")
+ all.children[[length(all.children)+1]] <- rk.XML.require(map="rkward::embedded")
+ } else {}
## components section
if(!is.null(components)){
diff --git a/packages/rkwarddev/R/rk.plugin.skeleton.R b/packages/rkwarddev/R/rk.plugin.skeleton.R
index a856e82..e462306 100644
--- a/packages/rkwarddev/R/rk.plugin.skeleton.R
+++ b/packages/rkwarddev/R/rk.plugin.skeleton.R
@@ -90,9 +90,13 @@
#' that they were generated by \code{rkwarddev} and changes should be done to the script.
#' @param hints Logical, if \code{TRUE} and you leave out optional entries (like \code{dependencies=NULL}), dummy sections will be added as comments.
#' @param indent.by A character string defining the indentation string to use.
-#' @param internal Logical, a simple switch to build an internal plugin for official distribution with RKWard. If set to \code{TRUE}, the
-#' plugin will have its namespace set to \code{"rkward"} and \code{<about>} info in the main component. No \code{DESCRIPTION} or
-#' \code{NAMESPACE} file will be written.
+#' @param internal Logical, a simple switch to build an internal plugin for official distribution with RKWard. If set to \code{TRUE}:
+#' \itemize{
+#' \item{The plugin will have its namespace set to \code{"rkward"}.}
+#' \item{The \code{<about>} info will also be available in the main component.}
+#' \item{\code{require.defaults} of \code{\link[rkwarddev:rk.XML.pluginmap]{rk.XML.pluginmap}} will be set to \code{FALSE}.}
+#' \item{No \code{DESCRIPTION} or \code{NAMESPACE} file will be written.}
+#' }
#' @return Character string with the path to the plugin root directory.
#' @seealso \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
#' @export
@@ -354,7 +358,8 @@ rk.plugin.skeleton <- function(about, path=tempdir(),
dependencies=dependencies.node,
namespace=pluginmap[["namespace"]],
# id.name=paste(gsub("[.]*|[[:space:]]*", "", pluginmap[["name"]]), "rkward", sep="_"))
- id.name=paste(pm.id.name, "rkward", sep="_"))
+ id.name=paste(pm.id.name, "rkward", sep="_"),
+ require.defaults=!isTRUE(internal))
cat(pasteXML(XML.pluginmap, shine=2, indent.by=indent.by), file=plugin.pluginmap)
} else {
pm.id.name <- name
diff --git a/packages/rkwarddev/R/rkwarddev-package.R b/packages/rkwarddev/R/rkwarddev-package.R
index 1fbdc73..55b0f3f 100644
--- a/packages/rkwarddev/R/rkwarddev-package.R
+++ b/packages/rkwarddev/R/rkwarddev-package.R
@@ -4,7 +4,7 @@
#' Package: \tab rkwarddev\cr
#' Type: \tab Package\cr
#' Version: \tab 0.07-1\cr
-#' Date: \tab 2015-02-01\cr
+#' Date: \tab 2015-02-04\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
diff --git a/packages/rkwarddev/inst/NEWS.Rd b/packages/rkwarddev/inst/NEWS.Rd
index 34530b6..9af3f54 100644
--- a/packages/rkwarddev/inst/NEWS.Rd
+++ b/packages/rkwarddev/inst/NEWS.Rd
@@ -1,7 +1,7 @@
\name{NEWS}
\title{News for Package 'rkwarddev'}
\encoding{UTF-8}
-\section{Changes in rkwarddev version 0.07-1 (2015-02-01)}{
+\section{Changes in rkwarddev version 0.07-1 (2015-02-04)}{
\subsection{fixed}{
\itemize{
\item \code{rk.XML.optionset()} does now allow to re-use objects defined in the same
@@ -34,6 +34,8 @@
\code{rk.XML.varslot()}.
\item \code{rk.XML.pluginmap()} now adds a \code{"po_id"} attribute to pluginmaps, necessary
for i18n
+ \item new attribute \code{"require.defaults"} in \code{rk.XML.pluginmap()} to add
+ rkward::menu and rkward::embedded as requirements
\item new attribute \code{"i18n"} added to several XML functions; it takes a list with
the named arguments \code{"comment"} or \code{"context"} to either produce an i18n
comment node or an \code{"i18n_context"} attribute
@@ -54,6 +56,8 @@
\code{"min_columns"}
\item <dropdown>, <radio> and <select> have gained \code{"string.quoted"} as
a valid property/modifier
+ \item new function \code{rk.XML.i18n()} to define translatable labels in logic sections
+ \item new function \code{rk.rkh.label()} for extracting labels from plugin elements
}
}
\subsection{changed}{
diff --git a/packages/rkwarddev/man/rk.XML.pluginmap.Rd b/packages/rkwarddev/man/rk.XML.pluginmap.Rd
index 82d64cb..bead0da 100644
--- a/packages/rkwarddev/man/rk.XML.pluginmap.Rd
+++ b/packages/rkwarddev/man/rk.XML.pluginmap.Rd
@@ -8,7 +8,7 @@ rk.XML.pluginmap(name, about = NULL, components, hierarchy = "test",
require = NULL, x11.context = NULL, import.context = NULL,
clean.name = TRUE, hints = FALSE, gen.info = TRUE,
dependencies = NULL, namespace = name, priority = "medium",
- id.name = "auto")
+ id.name = "auto", require.defaults = TRUE)
}
\arguments{
\item{name}{Character string, name of the plugin.}
@@ -69,6 +69,11 @@ defaults to "medium".}
\item{id.name}{Character string, a unique ID for this plugin element. If \code{"auto"},
an ID will be generated automatically from \code{name}.}
+
+\item{require.defaults}{Logical, if \code{TRUE},
+ \code{<require map="rkward::menu" />} and \code{<require map="rkward::embedded" />} will be added
+by default,
+ which ensures that the menu structure and embeddable plugins are loaded. It shouldn't hurt to set this.}
}
\value{
An object of class \code{XiMpLe.node}.
diff --git a/packages/rkwarddev/man/rk.plugin.skeleton.Rd b/packages/rkwarddev/man/rk.plugin.skeleton.Rd
index 3b52b50..ece95c3 100644
--- a/packages/rkwarddev/man/rk.plugin.skeleton.Rd
+++ b/packages/rkwarddev/man/rk.plugin.skeleton.Rd
@@ -134,9 +134,13 @@ that they were generated by \code{rkwarddev} and changes should be done to the s
\item{indent.by}{A character string defining the indentation string to use.}
\item{internal}{Logical,
- a simple switch to build an internal plugin for official distribution with RKWard. If set to \code{TRUE}, the
-plugin will have its namespace set to \code{"rkward"} and \code{<about>} info in the main component. No \code{DESCRIPTION} or
-\code{NAMESPACE} file will be written.}
+ a simple switch to build an internal plugin for official distribution with RKWard. If set to \code{TRUE}:
+\itemize{
+ \item{The plugin will have its namespace set to \code{"rkward"}.}
+ \item{The \code{<about>} info will also be available in the main component.}
+ \item{\code{require.defaults} of \code{\link[rkwarddev:rk.XML.pluginmap]{rk.XML.pluginmap}} will be set to \code{FALSE}.}
+ \item{No \code{DESCRIPTION} or \code{NAMESPACE} file will be written.}
+}}
}
\value{
Character string with the path to the plugin root directory.
diff --git a/packages/rkwarddev/man/rkwarddev-package.Rd b/packages/rkwarddev/man/rkwarddev-package.Rd
index a78a1d3..b54932d 100644
--- a/packages/rkwarddev/man/rkwarddev-package.Rd
+++ b/packages/rkwarddev/man/rkwarddev-package.Rd
@@ -12,7 +12,7 @@ A collection of tools for RKWard plugin development.
Package: \tab rkwarddev\cr
Type: \tab Package\cr
Version: \tab 0.07-1\cr
-Date: \tab 2015-02-01\cr
+Date: \tab 2015-02-04\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
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
rkward-cvs mailing list
rkward-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-cvs
More information about the rkward-tracker
mailing list