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

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Thu Oct 20 17:04:50 UTC 2011


Revision: 3982
          http://rkward.svn.sourceforge.net/rkward/?rev=3982&view=rev
Author:   m-eik
Date:     2011-10-20 17:04:50 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
rkwarddev: fixed rk.XML.about()

Modified Paths:
--------------
    trunk/rkward/packages/rkwarddev/ChangeLog
    trunk/rkward/packages/rkwarddev/R/rk.XML.about.R
    trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.R
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf

Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog	2011-10-20 16:50:52 UTC (rev 3981)
+++ trunk/rkward/packages/rkwarddev/ChangeLog	2011-10-20 17:04:50 UTC (rev 3982)
@@ -4,6 +4,7 @@
   - added "about" option to rk.XML.plugin() to overrule pluginmap defaults
   - added rk.plugin.component(), i.e. modularized the component generation, to allow for more than one
     component in rk.plugin.skeleton(), wich subsequently gained the new option "components"
+  - fixed dependency definition in rk.XML.about()
 
 ## 0.04-0 (2011-10-19)
   - for accurcy and consistency with the docs, the "properties" option changed to "modifiers" in rk.JS.vars()

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.about.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.about.R	2011-10-20 16:50:52 UTC (rev 3981)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.about.R	2011-10-20 17:04:50 UTC (rev 3982)
@@ -131,14 +131,16 @@
 			))
 	} else {
 		xml.package <- sapply(package, function(this.package){
+				pck.options <- names(this.package)
+				pck.attributes <- list(name=this.package[["name"]])
+				for (this.option in c("min", "max","repository" )){
+					if(this.option %in% pck.options){
+						pck.attributes[[this.option]] <- this.package[[this.option]]
+					} else {}
+				}
 				result <- new("XiMpLe.node",
 					name="package",
-					attributes=list(
-						name=this.package[["name"]],
-						"min_version"=this.package[["min"]],
-						"max_version"=this.package[["max"]],
-						repository=this.package[["repository"]]
-					))
+					attributes=pck.attributes)
 				return(result)
 			})
 	}
@@ -205,14 +207,23 @@
 					value=""
 			)
 	} else {
+		dep.options <- names(dependencies)
+		dep.attributes <- list()
+		if("rkward.min" %in% dep.options){
+			dep.attributes[["rkward_min_version"]] <- dependencies[["rkward.min"]]
+		} else {}
+		if("rkward.max" %in% dep.options){
+			dep.attributes[["rkward_max_version"]] <- dependencies[["rkward.max"]]
+		} else {}
+		if("R.min" %in% dep.options){
+			dep.attributes[["R_min_verion"]] <- dependencies[["R.min"]]
+		} else {}
+		if("R.max" %in% dep.options){
+			dep.attributes[["R_max_verion"]] <- dependencies[["R.max"]]
+		} else {}
 		xml.dependencies <- new("XiMpLe.node",
 					name="dependencies",
-					attributes=list(
-						"rkward_min_version"=dependencies[["rkward.min"]],
-						"rkward_max_version"=dependencies[["rkward.max"]],
-						"R_min_verion"=dependencies[["R.min"]],
-						"R_max_verion"=dependencies[["R.max"]]
-					),
+					attributes=dep.attributes,
 					children=xml.package,
 					value=""
 			)

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.R	2011-10-20 16:50:52 UTC (rev 3981)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.pluginmap.R	2011-10-20 17:04:50 UTC (rev 3982)
@@ -114,21 +114,30 @@
 		# get the IDs for hierarchy section
 		component.IDs <- sapply(components at children, function(this.comp){this.comp at attributes$id})
 	} else {
-		components.XML <- rk.XML.components(
-			as.list(sapply(components, function(this.comp){
-				# remove any directory names and .EXT endings
-				if(length(components) > 1) {
-					xml.basename <- gsub("(.*/)?([[:alnum:]_]*).+(.*)?", "\\2", this.comp, perl=TRUE)
+			components.XML.list <- list()
+			num.compos <- length(components)
+			compo.names <- names(components)
+			for (this.comp.num in 1:num.compos){
+				this.comp <- components[this.comp.num]
+				if(num.compos > 1) {
+					# let's see if we have entry names
+					if(length(compo.names) == length(components)){
+						xml.basename <- compo.names[this.comp.num]
+					} else {
+						# remove any directory names and .EXT endings
+						xml.basename <- gsub("(.*/)?([[:alnum:]_]*).+(.*)?", "\\2", this.comp, perl=TRUE)
+					}
 				} else {
 					xml.basename <- name.orig
 				}
-				rk.XML.component(
+				components.XML.list[[length(components.XML.list) + 1]] <- rk.XML.component(
 					label=xml.basename,
 					file=this.comp,
 					# if this ID get's a change, also change it in rk.plugin.skeleton(show=TRUE)!
 					id.name=auto.ids(paste(name, xml.basename, sep=""), prefix=ID.prefix("component"), chars=25))
-				}))
-		)
+				}
+		components.XML <- rk.XML.components(components.XML.list)
+
 		all.children[[length(all.children)+1]] <- components.XML
 		# get the IDs for hierarchy section
 		component.IDs <- sapply(components.XML at children, function(this.comp){this.comp at attributes$id})

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

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