http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/RealmService.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/RealmService.tmpl b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/RealmService.tmpl new file mode 100644 index 0000000..d009a21 --- /dev/null +++ b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/RealmService.tmpl @@ -0,0 +1,48 @@ +<%# + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * +-%> +package <%= packageName %>.model.security; + +@Mixins( MyRealmMixin.class ) +public interface RealmService + extends Realm, ServiceComposite, ServiceActivation +{ + class Mixin + extends SimpleAccountRealm + implements ServiceActivation + { + + private final PasswordService passwordService; + + public Mixin() + { + super(); + passwordService = new DefaultPasswordService(); + PasswordMatcher matcher = new PasswordMatcher(); + matcher.setPasswordService( passwordService ); + setCredentialsMatcher( matcher ); + } + + public void activateService() + throws Exception + { + // Create a test account + addAccount( "foo", passwordService.encryptPassword( "bar" ) ); + } + }
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/SecurityRepository.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/SecurityRepository.tmpl b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/SecurityRepository.tmpl new file mode 100644 index 0000000..5910c7c --- /dev/null +++ b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/SecurityRepository.tmpl @@ -0,0 +1,63 @@ +<%# + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * +-%> +package <%= packageName %>.model.security; + +import java.util.List; +import org.apache.polygene.api.concern.Concerns; +import org.apache.polygene.api.identity.Identity; +import org.apache.polygene.api.identity.StringIdentity; +import org.apache.polygene.api.unitofwork.UnitOfWorkFactory; +import org.apache.polygene.api.unitofwork.concern.UnitOfWorkConcern; +import org.apache.polygene.api.unitofwork.concern.UnitOfWorkPropagation; + +@Concerns( UnitOfWorkConcern.class ) +@Mixins( { SecurityRepository.EntiyStoreBackedMixin.class } ) +public interface SecurityRepository +{ + @UnitOfWorkPropagation + boolean verifyPassword( String user, String password ); + + @UnitOfWorkPropagation + List<String> findRoleNamesOfUser( String name ); + + + class EntityStoreBackedSecurityRepositoryMixin + implements SecurityRepository + { + @Structure + private UnitOfWorkFactory uowf; + + @Override + @UnitOfWorkPropagation + public boolean verifyPassword( String userName, String password ) + { + Identity identity = new StringIdentity("User-" + userName ); + User user = uow.currentUnitOfWork(User.class, identity ); + return user.verify( password ); + } + + @UnitOfWorkPropagation + public List<String> findRoleNamesOfUser( String name ) + { + } + } + + +} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/User.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/User.tmpl b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/User.tmpl new file mode 100644 index 0000000..f5008cd --- /dev/null +++ b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/User.tmpl @@ -0,0 +1,51 @@ +<%# + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * +-%> +package <%= packageName %>.model.security; + +import org.apache.polygene.api.injection.scope.This +import org.apache.polygene.api.mixin.Mixins; +import org.apache.polygene.api.property.Property; + +@Mixins( { User.Mixin } ) +public interface User +{ + + interface State + { + @Concerns( EncryptedStringPropertyConcern.class ) + Property<String> password(); + + ManyAssociation<Group> memberOf(); + } + + class Mixin + implements User + { + @Service + private HashingService hashing; + + @This + private State state; + + + } + + +} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/bootstrap.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/bootstrap.tmpl b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/bootstrap.tmpl new file mode 100644 index 0000000..7513044 --- /dev/null +++ b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/bootstrap.tmpl @@ -0,0 +1,53 @@ +<%# + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * +-%> +package <%= packageName %>.bootstrap.domain; + +import org.apache.polygene.api.common.Visibility; +import org.apache.polygene.bootstrap.AssemblyException; +import org.apache.polygene.bootstrap.LayerAssembly; +import org.apache.polygene.bootstrap.ModuleAssembly; +import org.apache.polygene.bootstrap.layered.ModuleAssembler; +import org.apache.polygene.library.shiro.assembly.StandaloneShiroAssembler; + +import <%= packageName %>.model.security.SecurityRepository; +import <%= packageName %>.model.security.HardcodedSecurityRepositoryMixin; + +public class SecurityModule + implements ModuleAssembler +{ + public static String NAME; + + @Override + public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module ) + throws AssemblyException + { + module.services( SecurityRepository.class ) + .withMixins( HardcodedSecurityRepositoryMixin.class ) + .visibleIn( Visibility.application ) + .instantiateOnStartup(); + + new StandaloneShiroAssembler(). + withConfig( configModule, Visibility.layer ). + assemble( module ); + module.services( RealmService.class ); + + return module; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/module.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/module.js b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/module.js new file mode 100644 index 0000000..5d21aaa --- /dev/null +++ b/tools/generator-polygene/app/templates/DomainLayer/SecurityModule/module.js @@ -0,0 +1,28 @@ +module.exports = { + + write: function (p) { + if( p.hasFeature("security")) { + + p.copyTemplate(p.ctx, + 'DomainLayer/SecurityModule/bootstrap.tmpl', + 'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/domain/SecurityModule.java'); + + copyFile(p, "CryptoConfiguration"); + copyFile(p, "CryptoException"); + copyFile(p, "CryptoService"); + copyFile(p, "EncryptedStringPropertyConcern"); + copyFile(p, "EntityStoreBackedSecurityRepositoryMixin"); + copyFile(p, "Group"); + copyFile(p, "RealmService"); + copyFile(p, "SecurityRepository"); + copyFile(p, "User"); + } + } + +}; + +function copyFile(p, clazz) { + p.copyTemplate(p.ctx, + 'DomainLayer/SecurityModule/' + clazz + '.tmpl', + 'model/src/main/java/' + p.javaPackageDir + '/model/security/' + clazz + '.java'); +} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl b/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl index 517942a..63401be 100644 --- a/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl +++ b/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl @@ -31,8 +31,10 @@ public class DomainLayer extends LayeredLayerAssembler public LayerAssembly assemble(LayerAssembly layer) throws AssemblyException { - createModule( layer, CrudModule.class ); <% if( hasFeature( 'rest api' ) ) { %> + createModule( layer, CrudModule.class ); +<% } %> +<% if( hasFeature( 'security' ) ) { %> createModule( layer, SecurityModule.class ); <% } %> return layer; http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainLayer/layer.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainLayer/layer.js b/tools/generator-polygene/app/templates/DomainLayer/layer.js new file mode 100644 index 0000000..3a32039 --- /dev/null +++ b/tools/generator-polygene/app/templates/DomainLayer/layer.js @@ -0,0 +1,10 @@ + +module.exports = { + + write: function (p) { + p.copyTemplate(p.ctx, + 'DomainLayer/bootstrap.tmpl', + 'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/domain/DomainLayer.java'); + p.copyModules(__dirname ); + } +}; http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainModule/Crud.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainModule/Crud.tmpl b/tools/generator-polygene/app/templates/DomainModule/Crud.tmpl deleted file mode 100644 index 95eed76..0000000 --- a/tools/generator-polygene/app/templates/DomainModule/Crud.tmpl +++ /dev/null @@ -1,41 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.model.<%= polygene.current.name %>; - -import org.apache.polygene.api.injection.scope.This; -import org.apache.polygene.api.mixin.Mixins; -import org.apache.polygene.api.property.Property; - -@Mixins( { <%= polygene.current.clazz.name %>.Mixin.class } ) -public interface <%= polygene.current.clazz.name %> -{ - interface State - { - Property<String> name(); // Sample hidden property - } - - class Mixin - implements <%= polygene.current.clazz.name %> - { - @This - private State state; // Sample reference to hidden property - - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainModule/Entity.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainModule/Entity.tmpl b/tools/generator-polygene/app/templates/DomainModule/Entity.tmpl deleted file mode 100644 index 9262cad..0000000 --- a/tools/generator-polygene/app/templates/DomainModule/Entity.tmpl +++ /dev/null @@ -1,41 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.model.<%= polygene.current.name %>; - -import org.apache.polygene.api.injection.scope.This -import org.apache.polygene.api.mixin.Mixins; -import org.apache.polygene.api.property.Property; - -@Mixins( { <%= polygene.current.clazz.name %>.Mixin } ) -public interface <%= polygene.current.clazz.name %> -{ - interface State - { - Property<String> name(); // Sample hidden property - } - - class Mixin - implements <%= polygene.current.clazz.name %> - { - @This - private State state; // Sample reference to hidden property - - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainModule/Object.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainModule/Object.tmpl b/tools/generator-polygene/app/templates/DomainModule/Object.tmpl deleted file mode 100644 index 27d6119..0000000 --- a/tools/generator-polygene/app/templates/DomainModule/Object.tmpl +++ /dev/null @@ -1,33 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.model.<%= polygene.current.name %>; - -import org.apache.polygene.api.injection.scope.This -import org.apache.polygene.api.mixin.Mixins; - -public class <%= polygene.current.clazz.name %> -{ - @Uses - private String name; // Sample @Uses injection - - @Structure - private ValueBuilderFactory vbf; // Sample @Structure injection - -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainModule/Service.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainModule/Service.tmpl b/tools/generator-polygene/app/templates/DomainModule/Service.tmpl deleted file mode 100644 index 0edefdc..0000000 --- a/tools/generator-polygene/app/templates/DomainModule/Service.tmpl +++ /dev/null @@ -1,36 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.model.<%= polygene.current.name %>; - -import org.apache.polygene.api.injection.scope.Structure; -import org.apache.polygene.api.mixin.Mixins; -import org.apache.polygene.api.value.ValueBuilderFactory; - -@Mixins( { <%= polygene.current.clazz.name %>.Mixin.class } ) -public interface <%= polygene.current.clazz.name %> -{ - class Mixin - implements <%= polygene.current.clazz.name %> - { - @Structure - private ValueBuilderFactory vbf; - } -} - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainModule/Value.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainModule/Value.tmpl b/tools/generator-polygene/app/templates/DomainModule/Value.tmpl deleted file mode 100644 index 9262cad..0000000 --- a/tools/generator-polygene/app/templates/DomainModule/Value.tmpl +++ /dev/null @@ -1,41 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.model.<%= polygene.current.name %>; - -import org.apache.polygene.api.injection.scope.This -import org.apache.polygene.api.mixin.Mixins; -import org.apache.polygene.api.property.Property; - -@Mixins( { <%= polygene.current.clazz.name %>.Mixin } ) -public interface <%= polygene.current.clazz.name %> -{ - interface State - { - Property<String> name(); // Sample hidden property - } - - class Mixin - implements <%= polygene.current.clazz.name %> - { - @This - private State state; // Sample reference to hidden property - - } -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/DomainModule/bootstrap.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/DomainModule/bootstrap.tmpl b/tools/generator-polygene/app/templates/DomainModule/bootstrap.tmpl deleted file mode 100644 index 54bc82d..0000000 --- a/tools/generator-polygene/app/templates/DomainModule/bootstrap.tmpl +++ /dev/null @@ -1,85 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.bootstrap.domain; - -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.LayerAssembly; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.bootstrap.layered.ModuleAssembler; -<% for( var idx in polygene.current.cruds) { %><%= "import " + packageName + ".model." + polygene.current.name + "." + polygene.current.cruds[idx].name + ";" %><% } %> -<% for( var idx in polygene.current.values) { %><%= "import " + packageName + ".model." + polygene.current.name + "." + polygene.current.values[idx].name + ";" %><% } %> -<% for( var idx in polygene.current.entities) { %><%= "import " + packageName + ".model." + polygene.current.name + "." + polygene.current.entities[idx].name + ";" %><% } %> -<% for( var idx in polygene.current.transients) { %><%= "import " + packageName + ".model." + polygene.current.name + "." + polygene.current.transients[idx].name + ";" %><% } %> -<% for( var idx in polygene.current.objects) { %><%= "import " + packageName + ".model." + polygene.current.name + "." + polygene.current.objects[idx].name + ";" %><% } %> -<% for( var idx in polygene.current.services) { %><%= "import " + packageName + ".model." + polygene.current.name + "." + polygene.current.services[idx].name + ";" %><% } %> - -import static org.apache.polygene.api.common.Visibility.layer; -import static org.apache.polygene.api.common.Visibility.application; - -public class <%- firstUpper(polygene.current.name) %>Module - implements ModuleAssembler -{ - @Override - public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module ) - throws AssemblyException - { -<% if( polygene.current.cruds ) { %> - <% for( var value in polygene.current.cruds ) { %> - <% var crud1 = polygene.current.cruds[value]; %> - module.values(<%- crud1.name + ".class" %>)<% if( crud1.visibility ) {%><%-".visibleIn(" + crud1.visibility +")"%><% } %>; - <% } %> - <% for( var value in polygene.current.cruds ) { %> - <% var crud2 = polygene.current.cruds[value]; %> - module.entities(<%= crud2.name + ".class" %>)<% if( crud2.visibility ) {%><%-".visibleIn(" + crud2.visibility +")"%><% } %>; - <% } %> -<% } %> -<% if( polygene.current.values ) { %> - <% for( var value in polygene.current.values ) { %> - <% var v = polygene.current.current[value]; %> - module.values(<%= v.name + ".class" %>)<% if( v.visibility ) {%><%-".visibleIn(" + v.visibility +")"%><% } %>; - <% } %> -<% } %> -<% if( polygene.current.entities ) { %> - <% for( var value in polygene.current.entities ) { %> - <% var entity = polygene.current.entities[value]; %> - module.values(<%= entity.name + ".class" %>)<% if( entity.visibility ) {%><%-".visibleIn(" + entity.visibility +")"%><% } %>; - <% } %> -<% } %> -<% if( polygene.current.transients ) { %> - <% for( var value in polygene.current.transients ) { %> - <% var trans = polygene.current.transients[value]; %> - module.values(<%= trans.name + ".class" %>)<% if( trans.visibility ) {%><%-".visibleIn(" + trans.visibility +")"%><% } %>; - <% } %> -<% } %> -<% if( polygene.current.objects ) { %> - <% for( var value in polygene.current.objects ) { %> - <% var obj = polygene.current.objects[value]; %> - module.values(<%= obj.name + ".class" %>)<% if( obj.visibility ) {%><%-".visibleIn(" + obj.visibility +")"%><% } %>; - <% } %> -<% } %> -<% if( polygene.current.services ) { %> - <% for( var value in polygene.current.services ) { %> - <% var service = polygene.current.services[value]; %> - module.values(<%= service.name + ".class" %>)<% if( service.visibility ) {%><%-".visibleIn(" + service.visibility +")"%><% } %>; - <% } %> -<% } %> - return module; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/FileConfigurationModule/bootstrap.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/FileConfigurationModule/bootstrap.tmpl b/tools/generator-polygene/app/templates/FileConfigurationModule/bootstrap.tmpl deleted file mode 100644 index ab2ad2c..0000000 --- a/tools/generator-polygene/app/templates/FileConfigurationModule/bootstrap.tmpl +++ /dev/null @@ -1,41 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.bootstrap.infrastructure; - -import org.apache.polygene.api.common.Visibility; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.LayerAssembly; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.bootstrap.layered.ModuleAssembler; -import org.apache.polygene.library.fileconfig.FileConfigurationAssembler; - -public class FileConfigurationModule - implements ModuleAssembler -{ - public static String NAME; - - @Override - public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module ) - throws AssemblyException - { - new FileConfigurationAssembler().visibleIn( Visibility.layer ).assemble( module ); - return module; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/Hero.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/Hero.tmpl b/tools/generator-polygene/app/templates/Heroes/Hero.tmpl deleted file mode 100644 index c3c7ec9..0000000 --- a/tools/generator-polygene/app/templates/Heroes/Hero.tmpl +++ /dev/null @@ -1,28 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.model.heroes; - -import org.apache.polygene.api.identity.HasIdentity; -import org.apache.polygene.api.property.Property; - -public interface Hero extends HasIdentity -{ - Property<String> name(); -} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/app.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/app.tmpl b/tools/generator-polygene/app/templates/Heroes/app.tmpl deleted file mode 100644 index 10fced4..0000000 --- a/tools/generator-polygene/app/templates/Heroes/app.tmpl +++ /dev/null @@ -1,103 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.app; - -import java.lang.reflect.UndeclaredThrowableException; -import org.apache.polygene.api.structure.Application; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.layered.LayeredApplicationAssembler; -import org.apache.polygene.library.restlet.PolygeneRestApplication; -import org.restlet.Context; -import org.restlet.routing.Filter; -import org.restlet.routing.Router; -import org.restlet.security.Enroler; -import org.restlet.security.Verifier; - -import <%= packageName %>.bootstrap.HeroesApplicationAssembler; -import <%= packageName %>.bootstrap.connectivity.ConnectivityLayer; -import <%= packageName %>.bootstrap.connectivity.RestApiModule; -import <%= packageName %>.model.heroes.Hero; -import <%= packageName %>.rest.security.SimpleEnroler; -import <%= packageName %>.rest.security.SimpleVerifier; - -public class Heroes extends ZrestApplication -{ - - public Heroes( Context context ) - throws AssemblyException - { - super( context ); - } - - @Override - protected void addRoutes( Router router ) - { - addResourcePath( "heroes", Hero.class, "/" ); - } - - @Override - protected LayeredApplicationAssembler createApplicationAssembler( String mode ) - throws AssemblyException - { - if( mode != null ) - { - return new HeroesApplicationAssembler( Application.Mode.valueOf( mode ) ); - } - return new HeroesApplicationAssembler( Application.Mode.production ); - } - - @Override - protected Verifier createVerifier() - { - return newObject( SimpleVerifier.class ); - } - - @Override - protected Enroler createEnroler() - { - return newObject( SimpleEnroler.class, this ); - } - - @Override - protected String getConnectivityLayer() - { - return ConnectivityLayer.NAME; - } - - @Override - protected String getConnectivityModule() - { - return RestApiModule.NAME; - } - - private <T> T newObject( Class<T> type, Object... uses ) - { - try - { - T instamce = type.newInstance(); - objectFactory.injectTo( instamce, uses ); - return instamce; - } - catch( Exception e ) - { - throw new UndeclaredThrowableException( e ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl b/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl deleted file mode 100644 index f8bf77e..0000000 --- a/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl +++ /dev/null @@ -1,63 +0,0 @@ -<%# - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * --%> -package <%= packageName %>.bootstrap; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.apache.polygene.bootstrap.ApplicationAssembly; -import org.apache.polygene.bootstrap.AssemblyException; -import org.apache.polygene.bootstrap.LayerAssembly; -import org.apache.polygene.bootstrap.ModuleAssembly; -import org.apache.polygene.bootstrap.layered.LayeredApplicationAssembler; - -import <%= packageName %>.bootstrap.connectivity.ConnectivityLayer; -import <%= packageName %>.bootstrap.domain.DomainLayer; -import <%= packageName %>.bootstrap.config.ConfigurationLayer; -import <%= packageName %>.bootstrap.infrastructure.InfrastructureLayer; - -public class HeroesApplicationAssembler extends LayeredApplicationAssembler -{ - private static final String NAME = "Heroes"; - private static final String VERSION = "1.0.alpha"; - - public HeroesApplicationAssembler( Application.Mode mode ) - throws AssemblyException - { - super( NAME, VERSION, mode ); - } - - @Override - protected void assembleLayers( ApplicationAssembly assembly ) - throws AssemblyException - { - LayerAssembly configLayer = createLayer( ConfigurationLayer.class ); - ModuleAssembly configModule = assemblerOf( ConfigurationLayer.class ).configModule(); - LayerAssembly domainLayer = createLayer( DomainLayer.class ); - LayerAssembly infraLayer = new InfrastructureLayer( configModule ).assemble( assembly.layer( InfrastructureLayer.NAME ) ); - LayerAssembly connectivityLayer = createLayer( ConnectivityLayer.class ); - connectivityLayer.uses( domainLayer ); - domainLayer.uses( infraLayer ); - infraLayer.uses( configLayer ); - } -} - http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/web.tmpl ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/web.tmpl b/tools/generator-polygene/app/templates/Heroes/web.tmpl deleted file mode 100644 index dda4f37..0000000 --- a/tools/generator-polygene/app/templates/Heroes/web.tmpl +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<%# - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - ~ - ~ -%> -<web-app xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" - version="2.5"> - - <display-name><%= polygene.name %></display-name> - - - <servlet> - <servlet-name>Restlet</servlet-name> - <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class> - <init-param> - <param-name>org.apache.polygene.runtime.mode</param-name> - <param-value>development</param-value> - </init-param> - <init-param> - <!-- Application class name --> - <param-name>org.restlet.application</param-name> - <param-value><%= packageName %>.app.Heroes</param-value> - </init-param> - <init-param> - <!-- Protocols to be bound to--> - <param-name>org.restlet.clients</param-name> - <param-value>HTTP HTTPS</param-value> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet-mapping> - <servlet-name>Restlet</servlet-name> - <url-pattern>/api/1/*</url-pattern> - </servlet-mapping> - -</web-app> http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.css ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.css b/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.css deleted file mode 100644 index cb651f5..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.css +++ /dev/null @@ -1,34 +0,0 @@ -nav a { - padding: 5px 10px; - text-decoration: none; - margin-top: 10px; - display: inline-block; - background-color: #eee; - border-radius: 4px; -} -nav a:visited, a:link { - color: #607D8B; -} -nav a:hover { - color: #039be5; - background-color: #CFD8DC; -} -nav a.router-link-active { - color: #039be5; -} -h1 { - font-size: 1.2em; - color: #999; - margin-bottom: 0; -} -h2 { - font-size: 2em; - margin-top: 0; - padding-top: 0; -} - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js deleted file mode 100644 index 18aeea4..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require('angular2/core'); -var router_1 = require('angular2/router'); -var heroes_component_1 = require('./heroes.component'); -var hero_detail_component_1 = require('./hero-detail.component'); -var dashboard_component_1 = require('./dashboard.component'); -var hero_service_1 = require('./hero.service'); -var AppComponent = (function () { - function AppComponent() { - this.title = 'Tour of Heroes'; - } - AppComponent = __decorate([ - core_1.Component({ - selector: 'my-app', - template: "\n <h1>{{title}}</h1>\n <nav>\n <a [routerLink]=\"['Dashboard']\">Dashboard</a>\n <a [routerLink]=\"['Heroes']\">Heroes</a>\n </nav>\n <router-outlet></router-outlet>\n ", - styleUrls: ['app/app.component.css'], - directives: [router_1.ROUTER_DIRECTIVES], - providers: [hero_service_1.HeroService] - }), - router_1.RouteConfig([ - // {path: '/', redirectTo: ['Dashboard'] }, - { path: '/dashboard', name: 'Dashboard', component: dashboard_component_1.DashboardComponent, useAsDefault: true }, - { path: '/heroes', name: 'Heroes', component: heroes_component_1.HeroesComponent }, - { path: '/detail/:id', name: 'HeroDetail', component: hero_detail_component_1.HeroDetailComponent } - ]) - ], AppComponent); - return AppComponent; -}()); -exports.AppComponent = AppComponent; -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=app.component.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js.map deleted file mode 100644 index bade57d..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;AAAA,qBAAwB,eAAe,CAAC,CAAA;AACxC,uBAA6C,iBAAiB,CAAC,CAAA;AAC/D,iCAA8B,oBAAoB,CAAC,CAAA;AACnD,sCAAkC,yBAAyB,CAAC,CAAA;AAC5D,oCAAiC,uBAAuB,CAAC,CAAA;AACzD,6BAA0B,gBAAgB,CAAC,CAAA;AAsB3C;IAAA;QACE,UAAK,GAAG,gBAAgB,CAAC;IAC3B,CAAC;IAtBD;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,kMAOT;YACD,SAAS,EAAE,CAAC,uBAAuB,CAAC;YACpC,UAAU,EAAE,CAAC,0BAAiB,CAAC;YAC/B,SAAS,EAAE,CAAC,0BAAW,CAAC;SACzB,CAAC;QACD,oBAAW,CAAC;YACX,2CAA2C;YAC3C,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,wCAAkB,EAAE,YAAY,EAAE,IAAI,EAAC;YAC1F,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,kCAAe,EAAC;YAC7D,EAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,2CAAmB,EAAC;SAC1E,CAAC;oBAAA;IAGF,mBAAC;AAAD,CAAC,AAFD,IAEC;AAFY,oBAAY,eAExB,CAAA;AAGD;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.ts deleted file mode 100644 index 222874b..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/app.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {Component} from 'angular2/core'; -import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router'; -import {HeroesComponent} from './heroes.component'; -import {HeroDetailComponent} from './hero-detail.component'; -import {DashboardComponent} from './dashboard.component'; -import {HeroService} from './hero.service'; - -@Component({ - selector: 'my-app', - template: ` - <h1>{{title}}</h1> - <nav> - <a [routerLink]="['Dashboard']">Dashboard</a> - <a [routerLink]="['Heroes']">Heroes</a> - </nav> - <router-outlet></router-outlet> - `, - styleUrls: ['app/app.component.css'], - directives: [ROUTER_DIRECTIVES], - providers: [HeroService] -}) -@RouteConfig([ - // {path: '/', redirectTo: ['Dashboard'] }, - {path: '/dashboard', name: 'Dashboard', component: DashboardComponent, useAsDefault: true}, - {path: '/heroes', name: 'Heroes', component: HeroesComponent}, - {path: '/detail/:id', name: 'HeroDetail', component: HeroDetailComponent} -]) -export class AppComponent { - title = 'Tour of Heroes'; -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.css ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.css b/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.css deleted file mode 100644 index b9d3215..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.css +++ /dev/null @@ -1,67 +0,0 @@ -[class*='col-'] { - float: left; -} -*, *:after, *:before { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -h3 { - text-align: center; margin-bottom: 0; -} -[class*='col-'] { - padding-right: 20px; - padding-bottom: 20px; -} -[class*='col-']:last-of-type { - padding-right: 0; -} -.grid { - margin: 0; -} -.col-1-4 { - width: 25%; -} -.module { - padding: 20px; - text-align: center; - color: #eee; - max-height: 120px; - min-width: 120px; - background-color: #607D8B; - border-radius: 2px; -} -h4 { - position: relative; -} -.module:hover { - background-color: #EEE; - cursor: pointer; - color: #607d8b; -} -.grid-pad { - padding: 10px 0; -} -.grid-pad > [class*='col-']:last-of-type { - padding-right: 20px; -} -@media (max-width: 600px) { - .module { - font-size: 10px; - max-height: 75px; } -} -@media (max-width: 1024px) { - .grid { - margin: 0; - } - .module { - min-width: 60px; - } -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.html ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.html b/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.html deleted file mode 100644 index 3fc7517..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.html +++ /dev/null @@ -1,15 +0,0 @@ -<h3>Top Heroes</h3> -<div class="grid grid-pad"> - <div *ngFor="#hero of heroes" class="col-1-4" (click)="gotoDetail(hero)"> - <div class="module hero"> - <h4>{{hero.name}}</h4> - </div> - </div> -</div> - - -<!-- -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license ---> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js deleted file mode 100644 index 9c69780..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require('angular2/core'); -var DashboardComponent = (function () { - function DashboardComponent(_heroService, _router) { - this._heroService = _heroService; - this._router = _router; - this.heroes = []; - } - DashboardComponent.prototype.ngOnInit = function () { - var _this = this; - this._heroService.getHeroes().then(function (heroes) { return _this.heroes = heroes.slice(1, 5); }); - }; - DashboardComponent.prototype.gotoDetail = function (hero) { - var link = ['HeroDetail', { id: hero.id }]; - this._router.navigate(link); - }; - DashboardComponent = __decorate([ - core_1.Component({ - selector: 'my-dashboard', - templateUrl: 'app/dashboard.component.html', - styleUrls: ['app/dashboard.component.css'] - }) - ], DashboardComponent); - return DashboardComponent; -}()); -exports.DashboardComponent = DashboardComponent; -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=dashboard.component.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js.map deleted file mode 100644 index 5bc16f0..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dashboard.component.js","sourceRoot":"","sources":["dashboard.component.ts"],"names":[],"mappings":";;;;;;;AAAA,qBAAgC,eAAe,CAAC,CAAA;AAUhD;IAGE,4BAAoB,YAAyB,EAAU,OAAe;QAAlD,iBAAY,GAAZ,YAAY,CAAa;QAAU,YAAO,GAAP,OAAO,CAAQ;QAFtE,WAAM,GAAW,EAAE,CAAC;IAEsD,CAAC;IAE3E,qCAAQ,GAAR;QAAA,iBAEC;QADC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAC,CAAC,CAAC,EAA/B,CAA+B,CAAC,CAAC;IAChF,CAAC;IAED,uCAAU,GAAV,UAAW,IAAU;QACnB,IAAI,IAAI,GAAG,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAjBH;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,cAAc;YACxB,WAAW,EAAE,8BAA8B;YAC3C,SAAS,EAAE,CAAC,6BAA6B,CAAC;SAC3C,CAAC;0BAAA;IAcF,yBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,0BAAkB,qBAa9B,CAAA;AAGD;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.ts deleted file mode 100644 index c8160d1..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/dashboard.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {Component, OnInit} from 'angular2/core'; -import {Router} from 'angular2/router'; -import {Hero} from './hero'; -import {HeroService} from './hero.service'; - -@Component({ - selector: 'my-dashboard', - templateUrl: 'app/dashboard.component.html', - styleUrls: ['app/dashboard.component.css'] -}) -export class DashboardComponent implements OnInit { - heroes: Hero[] = []; - - constructor(private _heroService: HeroService, private _router: Router) { } - - ngOnInit() { - this._heroService.getHeroes().then(heroes => this.heroes = heroes.slice(1,5)); - } - - gotoDetail(hero: Hero) { - let link = ['HeroDetail', { id: hero.id }]; - this._router.navigate(link); - } -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.css ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.css b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.css deleted file mode 100644 index 2a0e285..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.css +++ /dev/null @@ -1,36 +0,0 @@ -label { - display: inline-block; - width: 3em; - margin: .5em 0; - color: #607D8B; - font-weight: bold; -} -input { - height: 2em; - font-size: 1em; - padding-left: .4em; -} -button { - margin-top: 20px; - font-family: Arial; - background-color: #eee; - border: none; - padding: 5px 10px; - border-radius: 4px; - cursor: pointer; cursor: hand; -} -button:hover { - background-color: #cfd8dc; -} -button:disabled { - background-color: #eee; - color: #ccc; - cursor: auto; -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.html ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.html b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.html deleted file mode 100644 index 1e85e75..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.html +++ /dev/null @@ -1,16 +0,0 @@ -<div *ngIf="hero"> - <h2>{{hero.name}} details!</h2> - <div> - <label>id: </label>{{hero.id}}</div> - <div> - <label>name: </label> - <input [(ngModel)]="hero.name" placeholder="name"/> - </div> - <button (click)="goBack()">Back</button> -</div> - -<!-- -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license ---> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js deleted file mode 100644 index 56d5fa5..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require('angular2/core'); -var HeroDetailComponent = (function () { - function HeroDetailComponent(_heroService, _routeParams) { - this._heroService = _heroService; - this._routeParams = _routeParams; - } - HeroDetailComponent.prototype.ngOnInit = function () { - var _this = this; - var id = +this._routeParams.get('id'); - this._heroService.getHero(id).then(function (hero) { return _this.hero = hero; }); - }; - HeroDetailComponent.prototype.goBack = function () { - window.history.back(); - }; - HeroDetailComponent = __decorate([ - core_1.Component({ - selector: 'my-hero-detail', - templateUrl: 'app/hero-detail.component.html', - styleUrls: ['app/hero-detail.component.css'] - }) - ], HeroDetailComponent); - return HeroDetailComponent; -}()); -exports.HeroDetailComponent = HeroDetailComponent; -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=hero-detail.component.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js.map deleted file mode 100644 index 3928563..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hero-detail.component.js","sourceRoot":"","sources":["hero-detail.component.ts"],"names":[],"mappings":";;;;;;;AAAA,qBAAgC,eAAe,CAAC,CAAA;AAWhD;IAGE,6BAAoB,YAAyB,EACnC,YAAyB;QADf,iBAAY,GAAZ,YAAY,CAAa;QACnC,iBAAY,GAAZ,YAAY,CAAa;IACnC,CAAC;IAED,sCAAQ,GAAR;QAAA,iBAGC;QAFC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,KAAI,CAAC,IAAI,GAAG,IAAI,EAAhB,CAAgB,CAAC,CAAC;IAC/D,CAAC;IAED,oCAAM,GAAN;QACE,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAnBH;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,gCAAgC;YAC7C,SAAS,EAAE,CAAC,+BAA+B,CAAC;SAC7C,CAAC;2BAAA;IAgBF,0BAAC;AAAD,CAAC,AAfD,IAeC;AAfY,2BAAmB,sBAe/B,CAAA;AAGD;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.ts deleted file mode 100644 index 0181847..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero-detail.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {Component, OnInit} from 'angular2/core'; -import {RouteParams} from 'angular2/router'; - -import {Hero} from './hero'; -import {HeroService} from './hero.service'; - -@Component({ - selector: 'my-hero-detail', - templateUrl: 'app/hero-detail.component.html', - styleUrls: ['app/hero-detail.component.css'] -}) -export class HeroDetailComponent implements OnInit { - hero: Hero; - - constructor(private _heroService: HeroService, - private _routeParams: RouteParams) { - } - - ngOnInit() { - let id = +this._routeParams.get('id'); - this._heroService.getHero(id).then(hero => this.hero = hero); - } - - goBack() { - window.history.back(); - } -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js deleted file mode 100644 index 0c6fe2e..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -var Hero = (function () { - function Hero() { - } - return Hero; -}()); -exports.Hero = Hero; -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=hero.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js.map deleted file mode 100644 index 4a29533..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hero.js","sourceRoot":"","sources":["hero.ts"],"names":[],"mappings":";AAAA;IAAA;IAGA,CAAC;IAAD,WAAC;AAAD,CAAC,AAHD,IAGC;AAHY,YAAI,OAGhB,CAAA;AAGD;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js deleted file mode 100644 index 3f92669..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require('angular2/core'); -var mock_heroes_1 = require('./mock-heroes'); -var HeroService = (function () { - function HeroService() { - } - HeroService.prototype.getHeroes = function () { - return Promise.resolve(mock_heroes_1.HEROES); - }; - HeroService.prototype.getHero = function (id) { - return Promise.resolve(mock_heroes_1.HEROES).then(function (heroes) { return heroes.filter(function (hero) { return hero.id === id; })[0]; }); - }; - HeroService = __decorate([ - core_1.Injectable() - ], HeroService); - return HeroService; -}()); -exports.HeroService = HeroService; -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=hero.service.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js.map deleted file mode 100644 index 2485ba7..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hero.service.js","sourceRoot":"","sources":["hero.service.ts"],"names":[],"mappings":";;;;;;;AAAA,qBAAyB,eAAe,CAAC,CAAA;AACzC,4BAAyB,eAAe,CAAC,CAAA;AAGzC;IAAA;IAUA,CAAC;IATC,+BAAS,GAAT;QACE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAM,CAAC,CAAC;IACjC,CAAC;IAEF,6BAAO,GAAP,UAAQ,EAAU;QACf,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAM,CAAC,CAAC,IAAI,CACjC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,EAAE,KAAK,EAAE,EAAd,CAAc,CAAC,CAAC,CAAC,CAAC,EAAxC,CAAwC,CACnD,CAAC;IACJ,CAAC;IAVH;QAAC,iBAAU,EAAE;mBAAA;IAWb,kBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,mBAAW,cAUvB,CAAA;AAGD;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.ts deleted file mode 100644 index aee78a1..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.service.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {Injectable} from 'angular2/core'; -import {HEROES} from './mock-heroes'; - -@Injectable() -export class HeroService { - getHeroes() { - return Promise.resolve(HEROES); - } - - getHero(id: number) { - return Promise.resolve(HEROES).then( - heroes => heroes.filter(hero => hero.id === id)[0] - ); - } -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.ts deleted file mode 100644 index 812726c..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/hero.ts +++ /dev/null @@ -1,11 +0,0 @@ -export class Hero { - id: number; - name: string; -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.css ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.css b/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.css deleted file mode 100644 index 98e7ecc..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.css +++ /dev/null @@ -1,66 +0,0 @@ -.selected { - background-color: #CFD8DC !important; - color: white; -} -.heroes { - margin: 0 0 2em 0; - list-style-type: none; - padding: 0; - width: 15em; -} -.heroes li { - cursor: pointer; - position: relative; - left: 0; - background-color: #EEE; - margin: .5em; - padding: .3em 0; - height: 1.6em; - border-radius: 4px; -} -.heroes li:hover { - color: #607D8B; - background-color: #DDD; - left: .1em; -} -.heroes li.selected:hover { - background-color: #BBD8DC !important; - color: white; -} -.heroes .text { - position: relative; - top: -3px; -} -.heroes .badge { - display: inline-block; - font-size: small; - color: white; - padding: 0.8em 0.7em 0 0.7em; - background-color: #607D8B; - line-height: 1em; - position: relative; - left: -1px; - top: -4px; - height: 1.8em; - margin-right: .8em; - border-radius: 4px 0 0 4px; -} -button { - font-family: Arial; - background-color: #eee; - border: none; - padding: 5px 10px; - border-radius: 4px; - cursor: pointer; - cursor: hand; -} -button:hover { - background-color: #cfd8dc; -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.html ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.html b/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.html deleted file mode 100644 index 0688e6a..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.html +++ /dev/null @@ -1,21 +0,0 @@ -<div> - <h2>My Heroes</h2> - <ul class="heroes"> - <li *ngFor="#hero of heroes" - [class.selected]="hero === selectedHero" - (click)="onSelect(hero)"> - <span class="badge">{{hero.id}}</span> {{hero.name}} - </li> - </ul> - <div *ngIf="selectedHero"> - <h2>{{selectedHero.name | uppercase}} is my hero</h2> - <button (click)="gotoDetail()">View Details</button> - </div> -</div> - - -<!-- -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license ---> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js deleted file mode 100644 index a4c1363..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require('angular2/core'); -var hero_detail_component_1 = require('./hero-detail.component'); -var HeroesComponent = (function () { - function HeroesComponent(_heroService, _router) { - this._heroService = _heroService; - this._router = _router; - } - HeroesComponent.prototype.getHeroes = function () { - var _this = this; - this._heroService.getHeroes().then(function (heroes) { return _this.heroes = heroes; }); - }; - HeroesComponent.prototype.gotoDetail = function () { - this._router.navigate(['HeroDetail', { id: this.selectedHero.id }]); - }; - HeroesComponent.prototype.ngOnInit = function () { - this.getHeroes(); - }; - HeroesComponent.prototype.onSelect = function (hero) { this.selectedHero = hero; }; - HeroesComponent = __decorate([ - core_1.Component({ - selector: 'my-heroes', - templateUrl: 'app/heroes.component.html', - styleUrls: ['app/heroes.component.css'], - directives: [hero_detail_component_1.HeroDetailComponent] - }) - ], HeroesComponent); - return HeroesComponent; -}()); -exports.HeroesComponent = HeroesComponent; -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=heroes.component.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js.map deleted file mode 100644 index ca03d9d..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"heroes.component.js","sourceRoot":"","sources":["heroes.component.ts"],"names":[],"mappings":";;;;;;;AAAA,qBAAgC,eAAe,CAAC,CAAA;AAGhD,sCAAkC,yBAAyB,CAAC,CAAA;AAS5D;IAIE,yBAAoB,YAAyB,EAAU,OAAe;QAAlD,iBAAY,GAAZ,YAAY,CAAa;QAAU,YAAO,GAAP,OAAO,CAAQ;IAAI,CAAC;IAE3E,mCAAS,GAAT;QAAA,iBAEC;QADC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,KAAI,CAAC,MAAM,GAAG,MAAM,EAApB,CAAoB,CAAC,CAAC;IACrE,CAAC;IAED,oCAAU,GAAV;QACE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,kCAAQ,GAAR;QACE,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,kCAAQ,GAAR,UAAS,IAAU,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC;IAxBpD;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,2BAA2B;YACxC,SAAS,EAAE,CAAC,0BAA0B,CAAC;YACvC,UAAU,EAAE,CAAC,2CAAmB,CAAC;SAClC,CAAC;uBAAA;IAoBF,sBAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,uBAAe,kBAmB3B,CAAA;AAGD;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.ts deleted file mode 100644 index 0002025..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/heroes.component.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {Component, OnInit} from 'angular2/core'; -import {Router} from 'angular2/router'; -import {HeroService} from './hero.service'; -import {HeroDetailComponent} from './hero-detail.component'; -import {Hero} from './hero'; - -@Component({ - selector: 'my-heroes', - templateUrl: 'app/heroes.component.html', - styleUrls: ['app/heroes.component.css'], - directives: [HeroDetailComponent] -}) -export class HeroesComponent implements OnInit { - heroes: Hero[]; - selectedHero: Hero; - - constructor(private _heroService: HeroService, private _router: Router) { } - - getHeroes() { - this._heroService.getHeroes().then(heroes => this.heroes = heroes); - } - - gotoDetail() { - this._router.navigate(['HeroDetail', { id: this.selectedHero.id }]); - } - - ngOnInit() { - this.getHeroes(); - } - - onSelect(hero: Hero) { this.selectedHero = hero; } -} - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js deleted file mode 100644 index 9b4c297..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -var browser_1 = require('angular2/platform/browser'); -var router_1 = require('angular2/router'); -var hero_service_1 = require('./hero.service'); -var app_component_1 = require('./app.component'); -browser_1.bootstrap(app_component_1.AppComponent, [ - router_1.ROUTER_PROVIDERS, - hero_service_1.HeroService -]); -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=main.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js.map deleted file mode 100644 index c830f42..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";AAAA,wBAAwB,2BAA2B,CAAC,CAAA;AACpD,uBAA+B,iBAAiB,CAAC,CAAA;AACjD,6BAA0B,gBAAgB,CAAC,CAAA;AAC3C,8BAA2B,iBAAiB,CAAC,CAAA;AAE7C,mBAAS,CAAC,4BAAY,EAAE;IACtB,yBAAgB;IAChB,0BAAW;CACZ,CAAC,CAAC;AAGH;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/main.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/main.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/main.ts deleted file mode 100644 index 95e2d0b..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/main.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {bootstrap} from 'angular2/platform/browser'; -import {ROUTER_PROVIDERS} from 'angular2/router'; -import {HeroService} from './hero.service'; -import {AppComponent} from './app.component'; - -bootstrap(AppComponent, [ - ROUTER_PROVIDERS, - HeroService -]); - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js b/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js deleted file mode 100644 index 9fe1f8a..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -exports.HEROES = [ - { "id": 11, "name": "Mr. Nice" }, - { "id": 12, "name": "Narco" }, - { "id": 13, "name": "Bombasto" }, - { "id": 14, "name": "Celeritas" }, - { "id": 15, "name": "Magneta" }, - { "id": 16, "name": "RubberMan" }, - { "id": 17, "name": "Dynama" }, - { "id": 18, "name": "Dr IQ" }, - { "id": 19, "name": "Magma" }, - { "id": 20, "name": "Tornado" } -]; -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ -//# sourceMappingURL=mock-heroes.js.map \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js.map ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js.map b/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js.map deleted file mode 100644 index dc81a97..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mock-heroes.js","sourceRoot":"","sources":["mock-heroes.ts"],"names":[],"mappings":";AAEW,cAAM,GAAW;IAC3B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAC;IAC9B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAC;IAC3B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAC;IAC9B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAC;IAC/B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC;IAC7B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAC;IAC/B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAC;IAC5B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAC;IAC3B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAC;IAC3B,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC;CAC7B,CAAC;AAGF;;;;EAIE"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.ts ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.ts b/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.ts deleted file mode 100644 index 673cf53..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/app/mock-heroes.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Hero } from './hero'; - -export var HEROES: Hero[] = [ - {"id": 11, "name": "Mr. Nice"}, - {"id": 12, "name": "Narco"}, - {"id": 13, "name": "Bombasto"}, - {"id": 14, "name": "Celeritas"}, - {"id": 15, "name": "Magneta"}, - {"id": 16, "name": "RubberMan"}, - {"id": 17, "name": "Dynama"}, - {"id": 18, "name": "Dr IQ"}, - {"id": 19, "name": "Magma"}, - {"id": 20, "name": "Tornado"} -]; - - -/* -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license -*/ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a7bdc408/tools/generator-polygene/app/templates/Heroes/webapp/index.html ---------------------------------------------------------------------- diff --git a/tools/generator-polygene/app/templates/Heroes/webapp/index.html b/tools/generator-polygene/app/templates/Heroes/webapp/index.html deleted file mode 100644 index 753dd48..0000000 --- a/tools/generator-polygene/app/templates/Heroes/webapp/index.html +++ /dev/null @@ -1,41 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <script>document.write('<base href="' + document.location + '" />');</script> - <title>Angular 2 Tour of Heroes</title> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel="stylesheet" href="styles.css"> - - <!-- IE required polyfills, in this exact order --> - <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system-polyfills.js"></script> - <script src="https://npmcdn.com/[email protected]/es6/dev/src/testing/shims_for_IE.js"></script> - - <script src="https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system.js"></script> - <script src="https://npmcdn.com/[email protected]/lib/typescript.js"></script> - <script src="https://code.angularjs.org/2.0.0-beta.15/Rx.js"></script> - <script src="https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js"></script> - <script src="https://code.angularjs.org/2.0.0-beta.15/router.dev.js"></script> - <script> - System.config({ - transpiler: 'typescript', - typescriptOptions: { emitDecoratorMetadata: true }, - packages: {'app': {defaultExtension: 'ts'}} - }); - System.import('app/main') - .then(null, console.error.bind(console)); - </script> - </head> - - <body> - <my-app>Loading...</my-app> - </body> -</html> - - -<!-- -Copyright 2016 Google Inc. All Rights Reserved. -Use of this source code is governed by an MIT-style license that -can be found in the LICENSE file at http://angular.io/license ---> \ No newline at end of file
