Repository: polygene-java Updated Branches: refs/heads/develop 17a207993 -> 5e494ff53
Small fixes in polygene generator. Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/5e494ff5 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/5e494ff5 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/5e494ff5 Branch: refs/heads/develop Commit: 5e494ff5376ec96c4c4a8faca0aea7b42d702f38 Parents: 17a2079 Author: niclas <[email protected]> Authored: Tue Jun 27 11:22:47 2017 +0800 Committer: niclas <[email protected]> Committed: Tue Jun 27 11:22:47 2017 +0800 ---------------------------------------------------------------------- tools/generator-polygene/app/index.js | 28 ++++++++++++-------- .../DomainLayer/DomainModule/Crud.tmpl | 2 +- .../DomainLayer/DomainModule/Entity.tmpl | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/5e494ff5/tools/generator-polygene/app/index.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/index.js b/tools/generator-polygene/app/index.js index 80feb55..f248eda 100644 --- a/tools/generator-polygene/app/index.js +++ b/tools/generator-polygene/app/index.js @@ -196,7 +196,13 @@ module.exports = generators.Base.extend( this.log('Caching:', answers.caching); this.log('Features:', answers.features); answers.dbpool = answers.dbpool === undefined ? "DBCP" : answers.dbpool; - polygene = answers; + polygene.name = answers.name; + polygene.packageName = answers.packageName; + polygene.applicationtype = answers.applicationtype; + polygene.features = answers.features; + polygene.indexing = answers.indexing; + polygene.entitystore = answers.entitystore; + polygene.caching = answers.caching; }.bind(this) ); } @@ -353,7 +359,7 @@ function assignFunctions(polygene) { if (props) { imported["org.apache.polygene.api.property.Property"] = true; for (idx in props) { - if( props.hasOwnProperty(idx)) { + if (props.hasOwnProperty(idx)) { var prop = props[idx]; state.push('Property' + '<' + polygene.typeNameOnly(prop.type) + "> " + prop.name + "();"); imported[prop.type] = true; @@ -367,7 +373,7 @@ function assignFunctions(polygene) { if (assocs) { imported["org.apache.polygene.api.association.Association"] = true; for (idx in assocs) { - if( assocs.hasOwnProperty(idx)) { + if (assocs.hasOwnProperty(idx)) { assoc = assocs[idx]; state.push("Association" + '<' + polygene.typeNameOnly(assoc.type) + "> " + assoc.name + "();"); imported[assoc.type] = true; @@ -378,7 +384,7 @@ function assignFunctions(polygene) { if (assocs) { imported["org.apache.polygene.api.association.ManyAssociation"] = true; for (idx in assocs) { - if( assocs.hasOwnProperty(idx)) { + if (assocs.hasOwnProperty(idx)) { assoc = assocs[idx]; state.push("ManyAssociation<" + polygene.typeNameOnly(assoc.type) + "> " + assoc.name + "();"); imported[assoc.type] = true; @@ -389,7 +395,7 @@ function assignFunctions(polygene) { if (assocs) { imported["org.apache.polygene.api.association.NamedAssociation"] = true; for (idx in assocs) { - if( assocs.hasOwnProperty(idx)){ + if (assocs.hasOwnProperty(idx)) { assoc = assocs[idx]; state.push("NamedAssociation<" + polygene.typeNameOnly(assoc.type) + "> " + assoc.name + "();"); imported[assoc.type] = true; @@ -438,15 +444,15 @@ function assignFunctions(polygene) { } } state.push("/**"); - for( var idxDesc in prop.description ){ - if( prop.description.hasOwnProperty(idxDesc)){ + for (var idxDesc in prop.description) { + if (prop.description.hasOwnProperty(idxDesc)) { var desc = prop.description[idxDesc]; propertyFile.push("# " + desc); - state.push(" * " + desc ) + state.push(" * " + desc) } } state.push(" */"); - propertyFile.push(prop.name + "=" + propertyDefault +"\n"); + propertyFile.push(prop.name + "=" + propertyDefault + "\n"); state.push('Property' + '<' + polygene.typeNameOnly(prop.type) + "> " + prop.name + "();\n"); } } @@ -455,8 +461,8 @@ function assignFunctions(polygene) { state.push('/** TODO: remove sample property'); state.push(' */'); state.push('Property<String> name();'); - propertyFile.push("# This is just the sample configuration value. " ); - propertyFile.push("# TODO: Remove this config value " ); + propertyFile.push("# This is just the sample configuration value. "); + propertyFile.push("# TODO: Remove this config value "); propertyFile.push('name=sample config value'); } currentModule.state = state; http://git-wip-us.apache.org/repos/asf/polygene-java/blob/5e494ff5/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Crud.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Crud.tmpl b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Crud.tmpl index 51e508d..f77ec6d 100644 --- a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Crud.tmpl +++ b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Crud.tmpl @@ -45,7 +45,7 @@ public interface <%= polygene.current.clazz.name %> extends HasIdentity implements <%= polygene.current.clazz.name %> { @This - private State state; // Sample reference to hidden property + private State state; // Reference to private State instance } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/5e494ff5/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Entity.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Entity.tmpl b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Entity.tmpl index 51e508d..f77ec6d 100644 --- a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Entity.tmpl +++ b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Entity.tmpl @@ -45,7 +45,7 @@ public interface <%= polygene.current.clazz.name %> extends HasIdentity implements <%= polygene.current.clazz.name %> { @This - private State state; // Sample reference to hidden property + private State state; // Reference to private State instance } }
