问:
Failed to build the sal-distributed-datastore, Error while generating Javadoc in OpenDaylight Controller
I'm tring to execute an mvn clean install with the OpenDaylight Controller Project in Eclipse Oxygen (Oxygen.1a Release (4.7.1a)), i've tryed to build the code with the simple steps: I've imported the git code, from the url https://git.opendaylight.org/gerrit/p/<project_repo_name>.git, and runned with the goals: clean install -Pq (because i'm always get errors when the tests are executed if the controller are builded for the first time) and during the build i'm get this error when the build reach the odl-config-api part:

```<code>    [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.10:features-generate-descriptor (default-features-generate-descriptor) on project odl-config-api: Execution default-features-generate-descriptor of goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.10:features-generate-descriptor failed: A required class was missing while executing org.apache.karaf.tooling:karaf-maven-plugin:4.0.10:features-generate-descriptor: javax/xml/bind/JAXBException
[ERROR] -----------------------------------------------------
[ERROR] realm =    extension>org.apache.karaf.tooling:karaf-maven-plugin:4.0.10
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/tooling/karaf-maven-plugin/4.0.10/karaf-maven-plugin-4.0.10.jar
[ERROR] urls[1] = file:/C:/Users/kevin/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/C:/Users/kevin/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[ERROR] urls[3] = file:/C:/Users/kevin/.m2/repository/org/sonatype/aether/aether-util/1.11/aether-util-1.11.jar
[ERROR] urls[4] = file:/C:/Users/kevin/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[5] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[6] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/C:/Users/kevin/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/C:/Users/kevin/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar
[ERROR] urls[10] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/wagon/wagon-http/2.10/wagon-http-2.10.jar
[ERROR] urls[11] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/wagon/wagon-http-shared/2.10/wagon-http-shared-2.10.jar
[ERROR] urls[12] = file:/C:/Users/kevin/.m2/repository/org/jsoup/jsoup/1.7.2/jsoup-1.7.2.jar
[ERROR] urls[13] = file:/C:/Users/kevin/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[14] = file:/C:/Users/kevin/.m2/repository/org/apache/httpcomponents/httpclient/4.3.5/httpclient-4.3.5.jar
[ERROR] urls[15] = file:/C:/Users/kevin/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
[ERROR] urls[16] = file:/C:/Users/kevin/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar
[ERROR] urls[17] = file:/C:/Users/kevin/.m2/repository/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar
[ERROR] urls[18] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/org.apache.karaf.util/4.0.10/org.apache.karaf.util-4.0.10.jar
[ERROR] urls[19] = file:/C:/Users/kevin/.m2/repository/org/apache/felix/org.apache.felix.utils/1.10.0/org.apache.felix.utils-1.10.0.jar
[ERROR] urls[20] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/jaas/org.apache.karaf.jaas.boot/4.0.10/org.apache.karaf.jaas.boot-4.0.10.jar
[ERROR] urls[21] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/tooling/org.apache.karaf.tools.utils/4.0.10/org.apache.karaf.tools.utils-4.0.10.jar
[ERROR] urls[22] = file:/C:/Users/kevin/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] urls[23] = file:/C:/Users/kevin/.m2/repository/org/slf4j/slf4j-jdk14/1.7.12/slf4j-jdk14-1.7.12.jar
[ERROR] urls[24] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-4/maven-filtering-1.0-beta-4.jar
[ERROR] urls[25] = file:/C:/Users/kevin/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[26] = file:/C:/Users/kevin/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[27] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] urls[28] = file:/C:/Users/kevin/.m2/repository/org/apache/felix/maven-bundle-plugin/3.3.0/maven-bundle-plugin-3.3.0.jar
[ERROR] urls[29] = file:/C:/Users/kevin/.m2/repository/biz/aQute/bnd/biz.aQute.bndlib/3.3.0/biz.aQute.bndlib-3.3.0.jar
[ERROR] urls[30] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/maven-archiver/2.6/maven-archiver-2.6.jar
[ERROR] urls[31] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.7/maven-shared-utils-0.7.jar
[ERROR] urls[32] = file:/C:/Users/kevin/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[33] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-archiver/2.8.1/plexus-archiver-2.8.1.jar
[ERROR] urls[34] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-io/2.3.2/plexus-io-2.3.2.jar
[ERROR] urls[35] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
[ERROR] urls[36] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.jar
[ERROR] urls[37] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.jar
[ERROR] urls[38] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.jar
[ERROR] urls[39] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
[ERROR] urls[40] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
[ERROR] urls[41] = file:/C:/Users/kevin/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[42] = file:/C:/Users/kevin/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[43] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.jar
[ERROR] urls[44] = file:/C:/Users/kevin/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
[ERROR] urls[45] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.jar
[ERROR] urls[46] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.jar
[ERROR] urls[47] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.jar
[ERROR] urls[48] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.jar
[ERROR] urls[49] = file:/C:/Users/kevin/.m2/repository/org/jdom/jdom/1.1/jdom-1.1.jar
[ERROR] urls[50] = file:/C:/Users/kevin/.m2/repository/org/apache/felix/org.apache.felix.fileinstall/3.6.0/org.apache.felix.fileinstall-3.6.0.jar
[ERROR] urls[51] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/features/org.apache.karaf.features.core/4.0.10/org.apache.karaf.features.core-4.0.10.jar
[ERROR] urls[52] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/profile/org.apache.karaf.profile.core/4.0.10/org.apache.karaf.profile.core-4.0.10.jar.....
...I've removed part of the log error, since it's exceeded the body limit.
</code>```

My network is working normally and i'm runnig the eclipse in Windows 10 system (i don't know if it's really matter), i've don't edited any of the pom.xml.

I'm doing something wrong, or forgetting any step? Any tips?

UPDATE

I've got this new error aparentilly it's rellated to wrong writed code, but i know that's the code is correct.

ERROR:

```<code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar (attach-javadocs) on project sal-distributed-datastore: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\ShardWriteTransaction.java:26: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\ShardReadWriteTransaction.java:19: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\ShardReadTransaction.java:20: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\jmx\mbeans\shard\ShardStatsMXBean.java:17: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\AbstractDOMBrokerTransaction.java:34: warning: no @param for storeTxFactories
[ERROR] protected AbstractDOMBrokerTransaction(final Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\AbstractDOMBrokerTransaction.java:70: warning: no @return
[ERROR] protected Collection<T> getSubtransactions() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\DOMBrokerReadOnlyTransaction.java:30: warning: no @param for storeTxFactories
[ERROR] protected DOMBrokerReadOnlyTransaction(Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\DOMBrokerReadWriteTransaction.java:31: warning: no @param for commitImpl
[ERROR] protected DOMBrokerReadWriteTransaction(Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\DOMBrokerWriteOnlyTransaction.java:24: warning: no @param for commitImpl
[ERROR] public DOMBrokerWriteOnlyTransaction(Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DatastoreContext.java:558: warning: no @param for id
[ERROR] public Builder shardManagerPersistenceId(final String id) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DatastoreContext.java:558: warning: no @return
[ERROR] public Builder shardManagerPersistenceId(final String id) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for schemaService
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for initialDatastoreContext
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for datastoreSnapshotRestore
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for actorSystemProvider
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for bundleContext
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @return
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:25: warning: no @param for memberName
[ERROR] @Nonnull Collection<String> getMemberShardNames(@Nonnull MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:25: warning: no @return
[ERROR] @Nonnull Collection<String> getMemberShardNames(@Nonnull MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:30: warning: no @param for nameSpace
[ERROR] @Nullable String getModuleNameFromNameSpace(@Nonnull String nameSpace);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:30: warning: no @return
[ERROR] @Nullable String getModuleNameFromNameSpace(@Nonnull String nameSpace);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:35: warning: no @param for moduleName
[ERROR] @Nullable String getShardNameForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:35: warning: no @return
[ERROR] @Nullable String getShardNameForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:40: warning: no @param for prefix
[ERROR] @Nullable String getShardNameForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:40: warning: no @return
[ERROR] @Nullable String getShardNameForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:45: warning: no @param for shardName
[ERROR] @Nonnull Collection<MemberName> getMembersFromShardName(@Nonnull String shardName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:45: warning: no @return
[ERROR] @Nonnull Collection<MemberName> getMembersFromShardName(@Nonnull String shardName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:50: warning: no @param for moduleName
[ERROR] @Nullable ShardStrategy getStrategyForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:50: warning: no @return
[ERROR] @Nullable ShardStrategy getStrategyForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:55: warning: no @return
[ERROR] Set<String> getAllShardNames();
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:60: warning: no @param for config
[ERROR] void addModuleShardConfiguration(@Nonnull ModuleShardConfiguration config);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:65: warning: no @param for config
[ERROR] void addPrefixShardConfiguration(@Nonnull PrefixShardConfiguration config);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:70: warning: no @param for prefix
[ERROR] void removePrefixShardConfiguration(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:82: warning: no @return
[ERROR] Collection<MemberName> getUniqueMemberNamesForAllShards();
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:92: warning: no @param for shardName
[ERROR] void addMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:92: warning: no @param for memberName
[ERROR] void addMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:97: warning: no @param for shardName
[ERROR] void removeMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:97: warning: no @param for memberName
[ERROR] void removeMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:102: warning: no @param for prefix
[ERROR] @Nullable ShardStrategy getStrategyForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:102: warning: no @return
[ERROR] @Nullable ShardStrategy getStrategyForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\ModuleShardConfigProvider.java:22: warning: no @param for configuration
[ERROR] @Nonnull Map<String, ModuleConfig.Builder> retrieveModuleConfigs(@Nonnull Configuration configuration);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\ModuleShardConfigProvider.java:22: warning: no @return
[ERROR] @Nonnull Map<String, ModuleConfig.Builder> retrieveModuleConfigs(@Nonnull Configuration configuration);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\PrimaryShardInfo.java:42: warning: no @return
[ERROR] public @Nonnull ActorSelection getPrimaryShardActor() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\PrimaryShardInfo.java:49: warning: no @return
[ERROR] public short getPrimaryShardVersion() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\PrimaryShardInfo.java:57: warning: no @return
[ERROR] public @Nonnull Optional<DataTree> getLocalShardDataTree() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\RemovePrefixShardReplica.java:30: warning: no @param for memberName
[ERROR] public RemovePrefixShardReplica(@Nonnull final YangInstanceIdentifier prefix,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\RemoveShardReplica.java:29: warning: no @param for memberName
[ERROR] public RemoveShardReplica(@Nonnull String shardName, @Nonnull MemberName memberName) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\shardmanager\ShardManagerSnapshot.java:42: warning: no @param for shardList
[ERROR] public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\shardmanager\ShardManagerSnapshot.java:42: warning: no @return
[ERROR] public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\ActorContext.java:280: warning: no @return
[ERROR] public Future<ActorRef> findLocalShardAsync(final String shardName) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\ActorContext.java:416: warning: no @param for messageSupplier
[ERROR] public void broadcast(final Function<Short, Object> messageSupplier, Class<?> messageClass) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\ActorContext.java:416: warning: no @param for messageClass
[ERROR] public void broadcast(final Function<Short, Object> messageSupplier, Class<?> messageClass) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for rootIdentifier
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for nodes
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for schemaContext
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for logicalDatastoreType
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @return
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @throws for org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\sharding\DistributedShardFactory.java:52: warning: no @return
[ERROR] CompletionStage<Void> close();
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\generated-sources\config-binding\org\opendaylight\controller\config\yang\config\concurrent_data_broker\DomConcurrentDataBrokerModuleMXBean.java:25: warning: no @param for maxDataBrokerCommitQueueSize
[ERROR] void setMaxDataBrokerCommitQueueSize(java.lang.Integer maxDataBrokerCommitQueueSize);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\generated-sources\config-binding\org\opendaylight\controller\config\yang\config\concurrent_data_broker\DomConcurrentDataBrokerModuleMXBean.java:32: warning: no @param for maxDataBrokerFutureCallbackQueueSize
[ERROR] void setMaxDataBrokerFutureCallbackQueueSize(java.lang.Integer maxDataBrokerFutureCallbackQueueSize);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\generated-sources\config-binding\org\opendaylight\controller\config\yang\config\concurrent_data_broker\DomConcurrentDataBrokerModuleMXBean.java:39: warning: no @param for maxDataBrokerFutureCallbackPoolSize
[ERROR] void setMaxDataBrokerFutureCallbackPoolSize(java.lang.Integer maxDataBrokerFutureCallbackPoolSize);
[ERROR] ^
[ERROR]
[ERROR] Command line was: "C:\Program Files\Java\jdk-9.0.1\bin\javadoc.exe" @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\apidocs' dir.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :sal-distributed-datastore
</code>```

There's two errors, i've edited the question, because i've thinked that the initial error had been resolved with the -Pq,ide clean generate-sources but after execute this command i've got the second error.

Any ideia of what to do?

答:
The problem re. maven-javadoc-plugin seems to be due to "error: unknown tag: author:" - that's fixed by https://git.opendaylight.org/gerrit/#/c/66268/.  (FYI the JavaDoc output can be a bit confusing; it's only the lines where there is an "error: " at the end that cause the build to fail; all lines starting with [ERROR] but ending in "warning: " do not.)

The REAL question is why you hit this locally when this works for everyone else and on the ODL Jenkins build...  The reason for that is if we note your C:\Program Files\Java\jdk-9.0.1\... you appear to be building ODL on Java 9 - and that is not supported, yet! I've just proposed https://git.opendaylight.org/gerrit/#/c/66269/ to avoid similar problems for others in the future (until we're ready).  Until then, please both build and run ODL only with Java 8 and you will have a lot less problems.

PS: I was not crystal clear if you've fully resolved your first problem re. karaf-maven-plugin, and are now only asking about your second problem re. maven-javadoc-plugin - it's best to remove from your question what you have resolved, or open separate new questions for new things you run into. But the karaf-maven-plugin could very well have issues when running the build under Java 9 as well.

Body:
I'm tring to execute an mvn clean install with the OpenDaylight Controller Project in Eclipse Oxygen (Oxygen.1a Release (4.7.1a)), i've tryed to build the code with the simple steps: I've imported the git code, from the url https://git.opendaylight.org/gerrit/p/<project_repo_name>.git, and runned with the goals: clean install -Pq (because i'm always get errors when the tests are executed if the controller are builded for the first time) and during the build i'm get this error when the build reach the odl-config-api part:

    [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.10:features-generate-descriptor (default-features-generate-descriptor) on project odl-config-api: Execution default-features-generate-descriptor of goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.10:features-generate-descriptor failed: A required class was missing while executing org.apache.karaf.tooling:karaf-maven-plugin:4.0.10:features-generate-descriptor: javax/xml/bind/JAXBException
[ERROR] -----------------------------------------------------
[ERROR] realm =    extension>org.apache.karaf.tooling:karaf-maven-plugin:4.0.10
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/tooling/karaf-maven-plugin/4.0.10/karaf-maven-plugin-4.0.10.jar
[ERROR] urls[1] = file:/C:/Users/kevin/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/C:/Users/kevin/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[ERROR] urls[3] = file:/C:/Users/kevin/.m2/repository/org/sonatype/aether/aether-util/1.11/aether-util-1.11.jar
[ERROR] urls[4] = file:/C:/Users/kevin/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[5] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[6] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/C:/Users/kevin/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/C:/Users/kevin/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar
[ERROR] urls[10] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/wagon/wagon-http/2.10/wagon-http-2.10.jar
[ERROR] urls[11] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/wagon/wagon-http-shared/2.10/wagon-http-shared-2.10.jar
[ERROR] urls[12] = file:/C:/Users/kevin/.m2/repository/org/jsoup/jsoup/1.7.2/jsoup-1.7.2.jar
[ERROR] urls[13] = file:/C:/Users/kevin/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[14] = file:/C:/Users/kevin/.m2/repository/org/apache/httpcomponents/httpclient/4.3.5/httpclient-4.3.5.jar
[ERROR] urls[15] = file:/C:/Users/kevin/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
[ERROR] urls[16] = file:/C:/Users/kevin/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar
[ERROR] urls[17] = file:/C:/Users/kevin/.m2/repository/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar
[ERROR] urls[18] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/org.apache.karaf.util/4.0.10/org.apache.karaf.util-4.0.10.jar
[ERROR] urls[19] = file:/C:/Users/kevin/.m2/repository/org/apache/felix/org.apache.felix.utils/1.10.0/org.apache.felix.utils-1.10.0.jar
[ERROR] urls[20] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/jaas/org.apache.karaf.jaas.boot/4.0.10/org.apache.karaf.jaas.boot-4.0.10.jar
[ERROR] urls[21] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/tooling/org.apache.karaf.tools.utils/4.0.10/org.apache.karaf.tools.utils-4.0.10.jar
[ERROR] urls[22] = file:/C:/Users/kevin/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] urls[23] = file:/C:/Users/kevin/.m2/repository/org/slf4j/slf4j-jdk14/1.7.12/slf4j-jdk14-1.7.12.jar
[ERROR] urls[24] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-4/maven-filtering-1.0-beta-4.jar
[ERROR] urls[25] = file:/C:/Users/kevin/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[26] = file:/C:/Users/kevin/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[27] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] urls[28] = file:/C:/Users/kevin/.m2/repository/org/apache/felix/maven-bundle-plugin/3.3.0/maven-bundle-plugin-3.3.0.jar
[ERROR] urls[29] = file:/C:/Users/kevin/.m2/repository/biz/aQute/bnd/biz.aQute.bndlib/3.3.0/biz.aQute.bndlib-3.3.0.jar
[ERROR] urls[30] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/maven-archiver/2.6/maven-archiver-2.6.jar
[ERROR] urls[31] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.7/maven-shared-utils-0.7.jar
[ERROR] urls[32] = file:/C:/Users/kevin/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[33] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-archiver/2.8.1/plexus-archiver-2.8.1.jar
[ERROR] urls[34] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-io/2.3.2/plexus-io-2.3.2.jar
[ERROR] urls[35] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
[ERROR] urls[36] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.jar
[ERROR] urls[37] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.jar
[ERROR] urls[38] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.jar
[ERROR] urls[39] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
[ERROR] urls[40] = file:/C:/Users/kevin/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
[ERROR] urls[41] = file:/C:/Users/kevin/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[42] = file:/C:/Users/kevin/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[43] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.jar
[ERROR] urls[44] = file:/C:/Users/kevin/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
[ERROR] urls[45] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.jar
[ERROR] urls[46] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.jar
[ERROR] urls[47] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.jar
[ERROR] urls[48] = file:/C:/Users/kevin/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.jar
[ERROR] urls[49] = file:/C:/Users/kevin/.m2/repository/org/jdom/jdom/1.1/jdom-1.1.jar
[ERROR] urls[50] = file:/C:/Users/kevin/.m2/repository/org/apache/felix/org.apache.felix.fileinstall/3.6.0/org.apache.felix.fileinstall-3.6.0.jar
[ERROR] urls[51] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/features/org.apache.karaf.features.core/4.0.10/org.apache.karaf.features.core-4.0.10.jar
[ERROR] urls[52] = file:/C:/Users/kevin/.m2/repository/org/apache/karaf/profile/org.apache.karaf.profile.core/4.0.10/org.apache.karaf.profile.core-4.0.10.jar.....
...I've removed part of the log error, since it's exceeded the body limit.

My network is working normally and i'm runnig the eclipse in Windows 10 system (i don't know if it's really matter), i've don't edited any of the pom.xml.

I'm doing something wrong, or forgetting any step? Any tips?

UPDATE

I've got this new error aparentilly it's rellated to wrong writed code, but i know that's the code is correct.

ERROR:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar (attach-javadocs) on project sal-distributed-datastore: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\ShardWriteTransaction.java:26: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\ShardReadWriteTransaction.java:19: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\ShardReadTransaction.java:20: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\jmx\mbeans\shard\ShardStatsMXBean.java:17: error: unknown tag: author:
[ERROR] * @author: syedbahm
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\AbstractDOMBrokerTransaction.java:34: warning: no @param for storeTxFactories
[ERROR] protected AbstractDOMBrokerTransaction(final Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\AbstractDOMBrokerTransaction.java:70: warning: no @return
[ERROR] protected Collection<T> getSubtransactions() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\DOMBrokerReadOnlyTransaction.java:30: warning: no @param for storeTxFactories
[ERROR] protected DOMBrokerReadOnlyTransaction(Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\DOMBrokerReadWriteTransaction.java:31: warning: no @param for commitImpl
[ERROR] protected DOMBrokerReadWriteTransaction(Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\databroker\DOMBrokerWriteOnlyTransaction.java:24: warning: no @param for commitImpl
[ERROR] public DOMBrokerWriteOnlyTransaction(Object identifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DatastoreContext.java:558: warning: no @param for id
[ERROR] public Builder shardManagerPersistenceId(final String id) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DatastoreContext.java:558: warning: no @return
[ERROR] public Builder shardManagerPersistenceId(final String id) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for schemaService
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for initialDatastoreContext
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for datastoreSnapshotRestore
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for actorSystemProvider
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @param for bundleContext
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\DistributedDataStoreFactory.java:32: warning: no @return
[ERROR] public static AbstractDataStore createInstance(final SchemaService schemaService,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:25: warning: no @param for memberName
[ERROR] @Nonnull Collection<String> getMemberShardNames(@Nonnull MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:25: warning: no @return
[ERROR] @Nonnull Collection<String> getMemberShardNames(@Nonnull MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:30: warning: no @param for nameSpace
[ERROR] @Nullable String getModuleNameFromNameSpace(@Nonnull String nameSpace);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:30: warning: no @return
[ERROR] @Nullable String getModuleNameFromNameSpace(@Nonnull String nameSpace);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:35: warning: no @param for moduleName
[ERROR] @Nullable String getShardNameForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:35: warning: no @return
[ERROR] @Nullable String getShardNameForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:40: warning: no @param for prefix
[ERROR] @Nullable String getShardNameForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:40: warning: no @return
[ERROR] @Nullable String getShardNameForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:45: warning: no @param for shardName
[ERROR] @Nonnull Collection<MemberName> getMembersFromShardName(@Nonnull String shardName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:45: warning: no @return
[ERROR] @Nonnull Collection<MemberName> getMembersFromShardName(@Nonnull String shardName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:50: warning: no @param for moduleName
[ERROR] @Nullable ShardStrategy getStrategyForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:50: warning: no @return
[ERROR] @Nullable ShardStrategy getStrategyForModule(@Nonnull String moduleName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:55: warning: no @return
[ERROR] Set<String> getAllShardNames();
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:60: warning: no @param for config
[ERROR] void addModuleShardConfiguration(@Nonnull ModuleShardConfiguration config);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:65: warning: no @param for config
[ERROR] void addPrefixShardConfiguration(@Nonnull PrefixShardConfiguration config);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:70: warning: no @param for prefix
[ERROR] void removePrefixShardConfiguration(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:82: warning: no @return
[ERROR] Collection<MemberName> getUniqueMemberNamesForAllShards();
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:92: warning: no @param for shardName
[ERROR] void addMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:92: warning: no @param for memberName
[ERROR] void addMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:97: warning: no @param for shardName
[ERROR] void removeMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:97: warning: no @param for memberName
[ERROR] void removeMemberReplicaForShard(String shardName, MemberName memberName);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:102: warning: no @param for prefix
[ERROR] @Nullable ShardStrategy getStrategyForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\Configuration.java:102: warning: no @return
[ERROR] @Nullable ShardStrategy getStrategyForPrefix(@Nonnull DOMDataTreeIdentifier prefix);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\ModuleShardConfigProvider.java:22: warning: no @param for configuration
[ERROR] @Nonnull Map<String, ModuleConfig.Builder> retrieveModuleConfigs(@Nonnull Configuration configuration);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\config\ModuleShardConfigProvider.java:22: warning: no @return
[ERROR] @Nonnull Map<String, ModuleConfig.Builder> retrieveModuleConfigs(@Nonnull Configuration configuration);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\PrimaryShardInfo.java:42: warning: no @return
[ERROR] public @Nonnull ActorSelection getPrimaryShardActor() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\PrimaryShardInfo.java:49: warning: no @return
[ERROR] public short getPrimaryShardVersion() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\PrimaryShardInfo.java:57: warning: no @return
[ERROR] public @Nonnull Optional<DataTree> getLocalShardDataTree() {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\RemovePrefixShardReplica.java:30: warning: no @param for memberName
[ERROR] public RemovePrefixShardReplica(@Nonnull final YangInstanceIdentifier prefix,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\messages\RemoveShardReplica.java:29: warning: no @param for memberName
[ERROR] public RemoveShardReplica(@Nonnull String shardName, @Nonnull MemberName memberName) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\shardmanager\ShardManagerSnapshot.java:42: warning: no @param for shardList
[ERROR] public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\shardmanager\ShardManagerSnapshot.java:42: warning: no @return
[ERROR] public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\ActorContext.java:280: warning: no @return
[ERROR] public Future<ActorRef> findLocalShardAsync(final String shardName) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\ActorContext.java:416: warning: no @param for messageSupplier
[ERROR] public void broadcast(final Function<Short, Object> messageSupplier, Class<?> messageClass) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\ActorContext.java:416: warning: no @param for messageClass
[ERROR] public void broadcast(final Function<Short, Object> messageSupplier, Class<?> messageClass) {
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for rootIdentifier
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for nodes
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for schemaContext
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @param for logicalDatastoreType
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @return
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\datastore\utils\NormalizedNodeAggregator.java:42: warning: no @throws for org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException
[ERROR] public static Optional<NormalizedNode<?,?>> aggregate(final YangInstanceIdentifier rootIdentifier,
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\src\main\java\org\opendaylight\controller\cluster\sharding\DistributedShardFactory.java:52: warning: no @return
[ERROR] CompletionStage<Void> close();
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\generated-sources\config-binding\org\opendaylight\controller\config\yang\config\concurrent_data_broker\DomConcurrentDataBrokerModuleMXBean.java:25: warning: no @param for maxDataBrokerCommitQueueSize
[ERROR] void setMaxDataBrokerCommitQueueSize(java.lang.Integer maxDataBrokerCommitQueueSize);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\generated-sources\config-binding\org\opendaylight\controller\config\yang\config\concurrent_data_broker\DomConcurrentDataBrokerModuleMXBean.java:32: warning: no @param for maxDataBrokerFutureCallbackQueueSize
[ERROR] void setMaxDataBrokerFutureCallbackQueueSize(java.lang.Integer maxDataBrokerFutureCallbackQueueSize);
[ERROR] ^
[ERROR] C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\generated-sources\config-binding\org\opendaylight\controller\config\yang\config\concurrent_data_broker\DomConcurrentDataBrokerModuleMXBean.java:39: warning: no @param for maxDataBrokerFutureCallbackPoolSize
[ERROR] void setMaxDataBrokerFutureCallbackPoolSize(java.lang.Integer maxDataBrokerFutureCallbackPoolSize);
[ERROR] ^
[ERROR]
[ERROR] Command line was: "C:\Program Files\Java\jdk-9.0.1\bin\javadoc.exe" @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\Users\kevin\git\controller\opendaylight\md-sal\sal-distributed-datastore\target\apidocs' dir.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :sal-distributed-datastore

There's two errors, i've edited the question, because i've thinked that the initial error had been resolved with the -Pq,ide clean generate-sources but after execute this command i've got the second error.

Any ideia of what to do?


来源: stackexchange

问:
What is the diffrence between a function and a module?
I am very new to c++ and confused between what is the difference between modular programming and function oriented programming.I have never done modular programming so I just know modules by definition that it contains functions.So what is the difference between a sequential(function-oriented language)and modular programming?Thanks in advance.

EDIT:
I was reading about C++'s OOP.It started something like what is unstructured programming, than gave a basic idea about structured programming, than modular programming and finally,OOP.

答:
They are both ways of structuring your code. If your interested in function-oriented programming and want to understand it a bit better, I'd take a look at lisp. C++ isn't truly function oriented as every function should return a value yet C++ functions can return void  (making it a procedure rather than a function), so it's not a true functional programming language in the sense.

"I have never done modular programming so I just know modules by definition that it contains functions".

 Modules are a level higher than functions.

That's a good start.  Think of a function as a unit of work that does something and when you have several functions that you can group in a certain way, you put them in a module. So, string.h has a bunch of functions for working with strings, but you simply include the header and you have access to all those functions directly. You can then reuse those modules in other projects as you'd already used the modules previously and they've been (I assume) debugged and tested and stop people from reinventing the wheel. The whole point is to benefit from the cumulative experience.

I'd suggest you think of a project you'd like and write some functions and think about how you'd like to organize the code for another developer to use.

Hope this is of some use to you.

ContentLicense: CC BY-SA 3.0


问:
how to get value from html form and pass is to typescript in angular
Do anyone know how can I get value from HTML forms in typescript?

this is how my html page: login.component.html

```<code><form [formGroup]="loginForm" id="loginForm" (ngSubmit)="authUser()" #userForm="ngForm">
<div class="container">
  <div class="row">
    <div class="col-sm-6 col-sm-offset-3">
      <p><input type="email" formControlName="email" id="email" placeholder="Your email" [(ngModel)]="user.email" required></p>
    </div>
  </div>
  <div class="row">
    <div class="col-sm-6 col-sm-offset-3">
      <p><input type="password" formControlName="password" id="password" placeholder="Your password" [(ngModel)]="user.password" required></p>
    </div>
  </div>
   <div class="row">
    <div class="col-sm-6 col-sm-offset-3">
      <p><button class="btn btn-primary" type="submit" [disabled]="!bookForm.form.valid">Login</button> </p>
    </div>
  </div>
 </div>
</form>
<div *ngIf="edited" class="alert alert-success box-msg" role="alert">
        <strong>Successful Login!</strong>
</div>
</code>```

and this is my typescript: login.component.ts

```<code>import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { Router } from '@angular/router';
import { Http } from '@angular/http';
import { PostsService } from '../posts.service';
@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
  loginForm: FormGroup;
  login = false;
  users: any;

  user = {};
  constructor(private fb: FormBuilder, private http: Http, private router: Router, private postsService: PostsService) {
    this.postsService.getAllPosts().subscribe(users => {
      this.users = users;
    });

  }

  ngOnInit() {
    this.loginForm = this.fb.group({
      email: 'a@b.com',
      password: 'abc123.'

    });
  }
  authUser() {
    var i:number;
    var email:string = this.loginForm.value.email;
    var password:string = this.loginForm.value.password;
    var userType:string;
    var userEmail:string;
    for(i=0;i<this.users.length;i++){
      if(this.users[i].email == email && this.users[i].password == password){
         this.login = true
         userEmail = this.users[i].email;
         userType = this.users[i].accountType;
        }
    }
    if(this.login){
      console.log("Sucessful");
    }
    else{
      console.log("Unsucessful");

    }
  }

}
</code>```

I have tried a lot of methods but none of them seems to work for now my login the way my code words is that once the button is press it will not check whats in the html forms. but it will check againce var email:string = this.loginForm.value.email; and my database for the email and the value thats in var email:string = this.loginForm.value.email; have been hardcoded.

答:
You can try to get value from your ngModel and use .find function to filter your data it's easy and fast to get user details</p>

```<code>public userType: string;
public userEmail:string;
public loginUser:any;
authUser() {
    this.loginUser =  this.users.find(x => x.email == this.user.email && x.password == this.user.password);
    if(this.loginUser){
        this.login = true
        this.userEmail = this.loginUser.email;
        this.userType = this.loginUser.accountType;
    }
}
</code>```

Body:
Do anyone know how can I get value from HTML forms in typescript?

this is how my html page: login.component.html

<form [formGroup]="loginForm" id="loginForm" (ngSubmit)="authUser()" #userForm="ngForm">

<input type="email" formControlName="email" id="email" placeholder="Your email" [(ngModel)]="user.email" required>

<input type="password" formControlName="password" id="password" placeholder="Your password" [(ngModel)]="user.password" required>

<button class="btn btn-primary" type="submit" [disabled]="!bookForm.form.valid">Login</button>

</form>

        Successful Login!

and this is my typescript: login.component.ts

import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { Router } from '@angular/router';
import { Http } from '@angular/http';
import { PostsService } from '../posts.service';
@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
  loginForm: FormGroup;
  login = false;
  users: any;

  user = {};
  constructor(private fb: FormBuilder, private http: Http, private router: Router, private postsService: PostsService) {
    this.postsService.getAllPosts().subscribe(users => {
      this.users = users;
    });

  }

  ngOnInit() {
    this.loginForm = this.fb.group({
      email: 'a@b.com',
      password: 'abc123.'

    });
  }
  authUser() {
    var i:number;
    var email:string = this.loginForm.value.email;
    var password:string = this.loginForm.value.password;
    var userType:string;
    var userEmail:string;
    for(i=0;i<this.users.length;i++){
      if(this.users[i].email == email && this.users[i].password == password){
         this.login = true
         userEmail = this.users[i].email;
         userType = this.users[i].accountType;
        }
    }
    if(this.login){
      console.log("Sucessful");
    }
    else{
      console.log("Unsucessful");

    }
  }

}

I have tried a lot of methods but none of them seems to work for now my login the way my code words is that once the button is press it will not check whats in the html forms. but it will check againce var email:string = this.loginForm.value.email; and my database for the email and the value thats in var email:string = this.loginForm.value.email; have been hardcoded.

Body:
You can try to get value from your ngModel and use .find function to filter your data it's easy and fast to get user details

public userType: string;
public userEmail:string;
public loginUser:any;
authUser() {
    this.loginUser =  this.users.find(x => x.email == this.user.email && x.password == this.user.password);
    if(this.loginUser){
        this.login = true
        this.userEmail = this.loginUser.email;
        this.userType = this.loginUser.accountType;
    }
}


问:
Can I block prerender children on React Fiber?
I wrote  component on React Fiber.
This component receive 1 cond props, and that is true, render children.

```<code>"use strict";
import * as React from "react";
import * as ReactDOM from "react-dom";

interface IfProps {
  cond: boolean;
}

export class If extends React.Component<IfProps, {}> {
  render() {
    const {cond, children} = this.props;

    if (cond) {
      return children;
    } else {
      return null;
    }
  }
}

class TopComponent extends React.Component {
  render() {
    let str: any = null;

    return (
      <div>
        <If cond={str != null}>
          This part not showed.
          {str.length}
        </If>
      </div>
    );
  }
}

ReactDOM.render(<TopComponent />, document.getElementById("app"));
</code>```

Before React Fiber, this code works. But now, React Fiber causes error.

```<code>Uncaught TypeError: Cannot read property 'length' of null
</code>```

I guess that React Fiber render children before  component is rendered.
But this behavior break  component.

Can I stop prerender children of  component?

答:
The problem in your case isn't that react doesn't accept a null return value. (Which it does ReactComponent.render)
But your the children will get evaluated before they get handed over to the If component which means that str.length throws the error you're seeing.

Basic example based on your code.

Body:
I wrote  component on React Fiber.
This component receive 1 cond props, and that is true, render children.

"use strict";
import * as React from "react";
import * as ReactDOM from "react-dom";

interface IfProps {
  cond: boolean;
}

export class If extends React.Component<IfProps, {}> {
  render() {
    const {cond, children} = this.props;

    if (cond) {
      return children;
    } else {
      return null;
    }
  }
}

class TopComponent extends React.Component {
  render() {
    let str: any = null;

    return (

        <If cond={str != null}>
          This part not showed.
          {str.length}
        </If>

    );
  }
}

ReactDOM.render(<TopComponent />, document.getElementById("app"));

Before React Fiber, this code works. But now, React Fiber causes error.

Uncaught TypeError: Cannot read property 'length' of null

I guess that React Fiber render children before  component is rendered.
But this behavior break  component.

Can I stop prerender children of  component?


问:
XSLT transformation - set variable during iteration through set of nodes
My task is to create XSLT transformation.
In procedural language solution would look like this:

```<code>foreach( Book book in set)
{
   int importanceIndicator = 0;
   foreach( Page page in book )
   {
      if(page.name == "important_page")
      {
         importanceIndicator = 1;
         break;
      }
   }
   book.newField.importanceIndicator = importanceIndicator;
}
</code>```

How can I solve this problem in XSLT (which is very different from procedural languages)?

Sample XML files:

Input:

```<code><set>
    <book>
        <page name="important_page"></page>
        <page name="first_page"></page>
        <page name="important_page"></page>
        <page name="second_page"></page>
        <page name="important_page"></page>
    </book>
    <book>
        <page name="another_page"></page>
        <page name="first_page"></page>
        <page name="3_page"></page>
        <page name="second_page"></page>
        <page name="another_page"></page>
    </book>
    <book>
        <page name="important_page"></page>
        <page name="first_page"></page>
        <page name="important_page"></page>
        <page name="second_page"></page>
        <page name="another_page"></page>
    </book>
</set>
</code>```

Output:

```<code><set>
    <book>
        <newField importance_indicator="1"></newField>
    </book>
    <book>
        <newField importance_indicator="0"></newField>
    </book>
    <book>
        <newField importance_indicator="1"></newField>
    </book>
</set>
</code>```

答:
In XSLT, you don't need a loop to accomplish this. When you process the book node, you can examine the contents of its children.</p>

```<code><xsl:template match="book">
    <newfield>
         <xsl:choose>
            <xsl:when test="page/@name='important page'">
                <xsl:attribute name="importance_indicator" select="1">
            </xsl:when>
             <xsl:otherwise>
                <xsl:attribute name="importance_indicator" select="0">
            </xsl:otherwise>
</code>```

Body:
My task is to create XSLT transformation.
In procedural language solution would look like this:

foreach( Book book in set)
{
   int importanceIndicator = 0;
   foreach( Page page in book )
   {
      if(page.name == "important_page")
      {
         importanceIndicator = 1;
         break;
      }
   }
   book.newField.importanceIndicator = importanceIndicator;
}

How can I solve this problem in XSLT (which is very different from procedural languages)?

Sample XML files:

Input:

<set>
    <book>
        <page name="important_page"></page>
        <page name="first_page"></page>
        <page name="important_page"></page>
        <page name="second_page"></page>
        <page name="important_page"></page>
    </book>
    <book>
        <page name="another_page"></page>
        <page name="first_page"></page>
        <page name="3_page"></page>
        <page name="second_page"></page>
        <page name="another_page"></page>
    </book>
    <book>
        <page name="important_page"></page>
        <page name="first_page"></page>
        <page name="important_page"></page>
        <page name="second_page"></page>
        <page name="another_page"></page>
    </book>
</set>

Output:

<set>
    <book>
        <newField importance_indicator="1"></newField>
    </book>
    <book>
        <newField importance_indicator="0"></newField>
    </book>
    <book>
        <newField importance_indicator="1"></newField>
    </book>
</set>

Body:
In XSLT, you don't need a loop to accomplish this. When you process the book node, you can examine the contents of its children.

<xsl:template match="book">
    <newfield>
         <xsl:choose>
            <xsl:when test="page/@name='important page'">
                <xsl:attribute name="importance_indicator" select="1">
            </xsl:when>
             <xsl:otherwise>
                <xsl:attribute name="importance_indicator" select="0">
            </xsl:otherwise>


问:
Is there any way to get root view of an activity from a service?
I am working on an app in which I have to get all the views of the top most activity. This activity may or may not be of my app.
I am able to get all the views from a ViewGroup(root view).
Now I just want to get the root view of top most activity to do my work but I was not able to find any answers which gives me an idea to get root view of an activity from service.

I had used these methods:

```<code>View rootView = Window.DecorView.RootView;
</code>```

and

```<code>Context ctx = this;
ViewGroup rootView = ((Activity)ctx).getWindow().getDecorView().findViewById(android.R.id.content);
</code>```

But nothing works inside service class.
It reports that getWindow() and findViewById() did not work inside android service class.
So I just want to know is there any other way to do the same?
Thanks In Advance...:-)

答:
I am working on an app in which I have to get all the views of the top most activity. This activity may or may not be of my app.

Fortunately, this is not possible, for blindingly obvious privacy and security reasons.

It's also not possible from a simple programming standpoint, as the views in whatever you think "the top most activity" is are from another process. You cannot have an object from another process in yours, by definition.

Body:
I am working on an app in which I have to get all the views of the top most activity. This activity may or may not be of my app.
I am able to get all the views from a ViewGroup(root view).
Now I just want to get the root view of top most activity to do my work but I was not able to find any answers which gives me an idea to get root view of an activity from service.

I had used these methods:

View rootView = Window.DecorView.RootView;

and

Context ctx = this;
ViewGroup rootView = ((Activity)ctx).getWindow().getDecorView().findViewById(android.R.id.content);

But nothing works inside service class.
It reports that getWindow() and findViewById() did not work inside android service class.
So I just want to know is there any other way to do the same?
Thanks In Advance...:-)


问:
how to populate gridview from ajax call using Yii2
In my project, I have created a search box. when I type something and click the button "get info" I get all information in console window using ajax call. now I want to populate this data in yii2 gridview. data will different at every runtime. I want to give this data to $dataprovider of gridview is it possible??

here is code-
CompaniesController.php

```<code>public function actionCompanyinfo(){

    $text_in_search = $_GET['text_in_search'];
    $left_items_cat = ltrim($_GET['left_items_cat']);

    if($left_items_cat == "Companies"){

         $query = (new \yii\db\Query())
                ->select(['c.name', 'c.id'])
                ->from(['companies as c'])
                ->where('c.name LIKE :query')
                ->addParams([':query'=>'%'.$text_in_search.'%'])
                ->all();

        $response['comapnies_matching'] = $query;
            return \yii\helpers\Json::encode([
        $response
    ]);

    }
}
</code>```

companies/index.php

```<code>$form = ActiveForm::begin();
 $typeahead = $form->field($model, 'name')->textInput(['maxlength' => true]);

$getinfobtn = Html::SubmitButton( 'Get info', [ 'class' => 'btn btn-success' , 'id' =>'getinfo']) ;
   ActiveForm::end();
</code>```

myjsfile.js

```<code>$("#getinfo").click(function(){
        var text_in_search = $("#companies-name").val();
        var left_items_cat = $('#left-items li.active').text();
        var url = "index.php?r=companies/companyinfo";

        $.ajax({
        url: url,
        dataType: 'json',
        method: 'GET',
        data: {text_in_search,left_items_cat},
        success: function (data, textStatus, jqXHR) {
             // $( "#country"+id ).html(data[0].countries);
             console.log(data[0]);
           // **want to show this data in yii2 grid view**
        },
        error: function (jqXHR, textStatus, errorThrown) {
            console.log('An error occured!');
            alert('Error in ajax request');
        }
    });
</code>```

console window

```<code>comapnies_matching
:
Array(3)
0
:
{name: "ADC Therapeutics Sarl", id: "402"}
1
:
{name: "ADC Therapeutics Sarl", id: "407"}
2
:
{name: "ADC Therapeutics Sarl", id: "412"}
</code>```

how to show/ populate this data in gridview??

答:
You could render and return HTML of the Gridview from your controller, and then when you get the response. put the HTML code where you want to display it, probably where the current Gridview is contained.

Edit, added code example:

```<code>public function actionCompanyinfo(){
    $requestData = \Yii::$app->request->get();
    $text_in_search = isset($requestData['text_in_search']) ? $requestData['text_in_search'] : "";
    $left_items_cat = isset($requestData['left_items_cat']) ? trim($requestData['text_in_search']) : "";

    if($left_items_cat == "Companies"){
        $dataProvider = new ActiveDataProvider([
            'query' => (new \yii\db\Query())
            ->select(['c.name', 'c.id'])
            ->from(['companies as c'])
            ->where('c.name LIKE :query')
            ->addParams([':query'=>'%'.$text_in_search.'%']),
            'pagination' => [
                'pageSize' => 20,
            ],
        ]);

        return \yii\grid\GridView::widget([
            'dataProvider' => $dataProvider,
            'columns' => [
                ['class' => 'yii\grid\SerialColumn'],
                // your columns here...
                ['class' => 'yii\grid\ActionColumn'],
            ],
        ]);
    }
}
</code>```

On your VIEW file you should create an area (possible  element
And then in your js file where you are making the AJAX request, make sure the response does something like:

```<code>function (data, textStatus, jqXHR) {
    $("#show-grid-here").html(data); //or data[0], I'm not sure. try both.
},
</code>```

Body:
In my project, I have created a search box. when I type something and click the button "get info" I get all information in console window using ajax call. now I want to populate this data in yii2 gridview. data will different at every runtime. I want to give this data to $dataprovider of gridview is it possible??

here is code-
CompaniesController.php

public function actionCompanyinfo(){

    $text_in_search = $_GET['text_in_search'];
    $left_items_cat = ltrim($_GET['left_items_cat']);

    if($left_items_cat == "Companies"){

         $query = (new \yii\db\Query())
                ->select(['c.name', 'c.id'])
                ->from(['companies as c'])
                ->where('c.name LIKE :query')
                ->addParams([':query'=>'%'.$text_in_search.'%'])
                ->all();

        $response['comapnies_matching'] = $query;
            return \yii\helpers\Json::encode([
        $response
    ]);

    }
}

companies/index.php

$form = ActiveForm::begin();
 $typeahead = $form->field($model, 'name')->textInput(['maxlength' => true]);

$getinfobtn = Html::SubmitButton( 'Get info', [ 'class' => 'btn btn-success' , 'id' =>'getinfo']) ;
   ActiveForm::end();

myjsfile.js

$("#getinfo").click(function(){
        var text_in_search = $("#companies-name").val();
        var left_items_cat = $('#left-items li.active').text();
        var url = "index.php?r=companies/companyinfo";

        $.ajax({
        url: url,
        dataType: 'json',
        method: 'GET',
        data: {text_in_search,left_items_cat},
        success: function (data, textStatus, jqXHR) {
             // $( "#country"+id ).html(data[0].countries);
             console.log(data[0]);
           // **want to show this data in yii2 grid view**
        },
        error: function (jqXHR, textStatus, errorThrown) {
            console.log('An error occured!');
            alert('Error in ajax request');
        }
    });

console window

comapnies_matching
:
Array(3)
0
:
{name: "ADC Therapeutics Sarl", id: "402"}
1
:
{name: "ADC Therapeutics Sarl", id: "407"}
2
:
{name: "ADC Therapeutics Sarl", id: "412"}

how to show/ populate this data in gridview??

Body:
You could render and return HTML of the Gridview from your controller, and then when you get the response. put the HTML code where you want to display it, probably where the current Gridview is contained.

Edit, added code example:

public function actionCompanyinfo(){
    $requestData = \Yii::$app->request->get();
    $text_in_search = isset($requestData['text_in_search']) ? $requestData['text_in_search'] : "";
    $left_items_cat = isset($requestData['left_items_cat']) ? trim($requestData['text_in_search']) : "";

    if($left_items_cat == "Companies"){
        $dataProvider = new ActiveDataProvider([
            'query' => (new \yii\db\Query())
            ->select(['c.name', 'c.id'])
            ->from(['companies as c'])
            ->where('c.name LIKE :query')
            ->addParams([':query'=>'%'.$text_in_search.'%']),
            'pagination' => [
                'pageSize' => 20,
            ],
        ]);

        return \yii\grid\GridView::widget([
            'dataProvider' => $dataProvider,
            'columns' => [
                ['class' => 'yii\grid\SerialColumn'],
                // your columns here...
                ['class' => 'yii\grid\ActionColumn'],
            ],
        ]);
    }
}

On your VIEW file you should create an area (possible  element
And then in your js file where you are making the AJAX request, make sure the response does something like:

function (data, textStatus, jqXHR) {
    $("#show-grid-here").html(data); //or data[0], I'm not sure. try both.
},


答:
You can use this function to read the file content and store it in a string container in C++. Maybe you can split the string based on v's</p>

```<code>#include <stringstream>
#include <string>
#include <vector>
#include <iostream>

using namespace std;

    string ReadFromFile(string FilePath)
    {
        ifstream file(FilePath);
        string test;
        cout << "path: " << FilePath;
        try
        {
            std::stringstream buffer;
            buffer << file.rdbuf();
            test = buffer.str();
            cout << test;
            return test;
        }
        catch (exception &e)
        {
            throw std::exception(e.what());
        }
    }

    std::vector<string> SplitStringIntoMultipleParameters(string input, string delimiter)
    {
    std::stringstream stringStream(input);
    std::string line;

    std::vector<string> TokenizedStringVector;

    while (std::getline(stringStream, line))
    {
        size_t prev = 0, pos;
        while ((pos = line.find_first_of(delimiter, prev)) != string::npos)
        {
            if (pos > prev)
                TokenizedStringVector.push_back(line.substr(prev, pos - prev));
            prev = pos + 1;
        }
        if (prev < line.length())
            TokenizedStringVector.push_back(line.substr(prev, string::npos));
    }
    return TokenizedStringVector;
}

int main(int argc, char **argv)
{
 string FilePath;
 if(argc == 2)
 {
   FilePath = argv[1];
 }

  string TextReadFromFile = ReadFromFile(FilePath);
  std::vector<string> tokenizedString = SplitStringIntoMultipleParameters(TextReadFromFile, "v");

//Do required calculations by iterating over the vector of strings

return 0;
}
</code>```

Title: how to read file from a specific point make changes in the same file?C++

Body:
I have to read file contains whats given below.
Read the coordinates which come after the v's, multiply 1st with  user input x and second with y and third with z, for each line staring with v.
Have to write these changes in the same file.
can someone please help with c++

OBJ file created by ply_to_obj.c

g Object001

v  -0.57735  -0.57735  0.57735 v  0.934172  0.356822  0 v  0.934172
  -0.356822  0 v  -0.934172  0.356822  0 v  -0.934172  -0.356822  0 v  0  0.934172  0.356822 v  0  0.934172  -0.356822 v  0.356822  0  -0.934172 v  -0.356822  0  -0.934172 v  0  -0.934172  -0.356822 v  0  -0.934172
  0.356822 v  0.356822  0  0.934172 v  -0.356822  0  0.934172 v  0.57735  0.57735  -0.57735 v  0.57735  0.57735  0.57735 v  -0.57735  0.57735  -0.57735 v  -0.57735  0.57735  0.57735 v  0.57735  -0.57735  -0.57735 v  0.57735  -0.57735  0.57735 v  -0.57735  -0.57735  -0.57735

f  19  3  2 f  12  19  2 f  15  12  2 f  8  14  2 f  18  8  2 f  3  18
  2 f  20  5  4 f  9  20  4 f  16  9  4 f  13  17  4 f  1  13  4 f  5  1
  4 f  7  16  4 f  6  7  4 f  17  6  4 f  6  15  2 f  7  6  2 f  14  7
  2 f  10  18  3 f  11  10  3 f  19  11  3 f  11  1  5 f  10  11  5 f
  20  10  5 f  20  9  8 f  10  20  8 f  18  10  8 f  9  16  7 f  8  9  7
  f  14  8  7 f  12  15  6 f  13  12  6 f  17  13  6 f  13  1  11 f  12
  13  11 f  19  12  11

Body:
You can use this function to read the file content and store it in a string container in C++. Maybe you can split the string based on v's

#include <stringstream>
#include <string>
#include <vector>
#include <iostream>

using namespace std;

    string ReadFromFile(string FilePath)
    {
        ifstream file(FilePath);
        string test;
        cout << "path: " << FilePath;
        try
        {
            std::stringstream buffer;
            buffer << file.rdbuf();
            test = buffer.str();
            cout << test;
            return test;
        }
        catch (exception &e)
        {
            throw std::exception(e.what());
        }
    }

    std::vector<string> SplitStringIntoMultipleParameters(string input, string delimiter)
    {
    std::stringstream stringStream(input);
    std::string line;

    std::vector<string> TokenizedStringVector;

    while (std::getline(stringStream, line))
    {
        size_t prev = 0, pos;
        while ((pos = line.find_first_of(delimiter, prev)) != string::npos)
        {
            if (pos > prev)
                TokenizedStringVector.push_back(line.substr(prev, pos - prev));
            prev = pos + 1;
        }
        if (prev < line.length())
            TokenizedStringVector.push_back(line.substr(prev, string::npos));
    }
    return TokenizedStringVector;
}

int main(int argc, char **argv)
{
 string FilePath;
 if(argc == 2)
 {
   FilePath = argv[1];
 }

  string TextReadFromFile = ReadFromFile(FilePath);
  std::vector<string> tokenizedString = SplitStringIntoMultipleParameters(TextReadFromFile, "v");

//Do required calculations by iterating over the vector of strings

return 0;
}


问:
ftp_get fails but no error is reported
I can't download a file from the FTP server to my local computer. I keep on getting false from ftp_get

```<code>// define variables
$folder_path = "Applications/MAMP/htdocs/infoscreen/PVdata";
$local_file = fopen ("newpv.csv",'w');
$server_file = "tlxesb@pv-systems.dk-171206100007";

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// turn passive mode on
ftp_pasv($conn_id, true);

// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
    echo "Successfully written to $local_file\n";
} else {
    echo "There was a problem\n";
}

// close the connection
ftp_close($conn_id);
</code>```

答:
ftp_get takes a path to a local path as the second $local_file argument, not a file handle:

```<code>$local_file = "newpv.csv";
ftp_get($conn_id, "newpv.csv", $server_file, FTP_BINARY);
</code>```

Or maybe you wanted to use ftp_fget, which takes a handle:

```<code>$handle = fopen("newpv.csv", 'w');
ftp_fget($conn_id, $handle, $server_file, FTP_BINARY)
</code>```

Though it makes sense only, if you want to do something more with the file, otherwise use the simple ftp_put.

Also, make sure you close the handle, once the upload finishes:

```<code>fclose($handle);
</code>```

Title: ftp_get fails but no error is reported

Body:
I can't download a file from the FTP server to my local computer. I keep on getting false from ftp_get

// define variables
$folder_path = "Applications/MAMP/htdocs/infoscreen/PVdata";
$local_file = fopen ("newpv.csv",'w');
$server_file = "tlxesb@pv-systems.dk-171206100007";

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// turn passive mode on
ftp_pasv($conn_id, true);

// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
    echo "Successfully written to $local_file\n";
} else {
    echo "There was a problem\n";
}

// close the connection
ftp_close($conn_id);

Body:
ftp_get takes a path to a local path as the second $local_file argument, not a file handle:

$local_file = "newpv.csv";
ftp_get($conn_id, "newpv.csv", $server_file, FTP_BINARY);

Or maybe you wanted to use ftp_fget, which takes a handle:

$handle = fopen("newpv.csv", 'w');
ftp_fget($conn_id, $handle, $server_file, FTP_BINARY)

Though it makes sense only, if you want to do something more with the file, otherwise use the simple ftp_put.

Also, make sure you close the handle, once the upload finishes:

fclose($handle);

ContentLicense: CC BY-SA 4.0


答:
First start off with the identity template (which in this case will just copy the set node)

```<code><xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>
</code>```

Then, as you are transforming book elements, you need a new template that matches book, where you can copy the book element and add a newField element

```<code><xsl:template match="book">
    <xsl:copy>
        <newField>
           <!-- Add code for attribute -->
        </newField>
    </xsl:copy>
</xsl:template>
</code>```

And to create the attribute, you can use xsl:attribute with an xsl:choose containing your condition to check

```<code>    <xsl:attribute name="importance_indicator">
        <xsl:choose>
            <xsl:when test="page[@name='important_page']">1</xsl:when>
            <xsl:otherwise>0</xsl:otherwise>
        </xsl:choose>
    </xsl:attribute>
</code>```

Try this XSLT

```<code><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes" />

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="book">
        <xsl:copy>
            <newField>
                <xsl:attribute name="importance_indicator">
                    <xsl:choose>
                        <xsl:when test="page[@name='important_page']">1</xsl:when>
                        <xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:attribute>
            </newField>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>
</code>```

Note that the template matching "book" can be simplified, by using Attribute Value Templates (indicated by the { } symbols which cause the expression inside to be evaluated, rather than output literally)

```<code><xsl:template match="book">
    <xsl:copy>
        <newField importance_indicator="{number(boolean(page[@name='important_page']))}"/>
    </xsl:copy>
</xsl:template>
</code>```

So page[@name='important_page']) will select the page if it is an "important_page". boolean() will return true or false depending if that page exists, and number will then convert "true" to "1" or "false" to "0".

Title: XSLT transformation - set variable during iteration through set of nodes

Body:
First start off with the identity template (which in this case will just copy the set node)

<xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

Then, as you are transforming book elements, you need a new template that matches book, where you can copy the book element and add a newField element

<xsl:template match="book">
    <xsl:copy>
        <newField>
           <!-- Add code for attribute -->
        </newField>
    </xsl:copy>
</xsl:template>

And to create the attribute, you can use xsl:attribute with an xsl:choose containing your condition to check

    <xsl:attribute name="importance_indicator">
        <xsl:choose>
            <xsl:when test="page[@name='important_page']">1</xsl:when>
            <xsl:otherwise>0</xsl:otherwise>
        </xsl:choose>
    </xsl:attribute>

Try this XSLT

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes" />

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="book">
        <xsl:copy>
            <newField>
                <xsl:attribute name="importance_indicator">
                    <xsl:choose>
                        <xsl:when test="page[@name='important_page']">1</xsl:when>
                        <xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:attribute>
            </newField>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>

Note that the template matching "book" can be simplified, by using Attribute Value Templates (indicated by the { } symbols which cause the expression inside to be evaluated, rather than output literally)

<xsl:template match="book">
    <xsl:copy>
        <newField importance_indicator="{number(boolean(page[@name='important_page']))}"/>
    </xsl:copy>
</xsl:template>

So page[@name='important_page']) will select the page if it is an "important_page". boolean() will return true or false depending if that page exists, and number will then convert "true" to "1" or "false" to "0".


问:
sapui5 how can i get selected item from value help into table cell?
I have a table.a column consists of input fields. How can I get value from searchHelpDialog to table item?

Below is a sample table:

And the value help dialog:

答:
You can add the id of the field as custom data to your value help dialog.
You can get the id from the oEvent.

```<code>openValueHelpDialog: function(oEvent) {
    var oDialog = sap.ui.xmlfragment();
    var oField = new sap.ui.core.CustomData();
    oField.setKey("field");
    oField.setValue(oEvent.getParameter("id"));
    oDialog.addCustomData(oField);
    oDialog.open();
}`
</code>```

In the handleConfirm function you can then set value into the field with the id from the custom data:

```<code>handleConfirm: function(oEvent) {
    var sFieldId = oEvent.getSource().data("field");
    var oField = this.getView().byId(sFieldId);

    var sSelectedValue = oEvent.getParameter("selectedItem");
    oField.setValue(sSelectedValue);
}
</code>```

Body:
You can add the id of the field as custom data to your value help dialog.
You can get the id from the oEvent.

openValueHelpDialog: function(oEvent) {
    var oDialog = sap.ui.xmlfragment();
    var oField = new sap.ui.core.CustomData();
    oField.setKey("field");
    oField.setValue(oEvent.getParameter("id"));
    oDialog.addCustomData(oField);
    oDialog.open();
}`

In the handleConfirm function you can then set value into the field with the id from the custom data:

handleConfirm: function(oEvent) {
    var sFieldId = oEvent.getSource().data("field");
    var oField = this.getView().byId(sFieldId);

    var sSelectedValue = oEvent.getParameter("selectedItem");
    oField.setValue(sSelectedValue);
}


问:
Can aws lambda function invoked using RSS feeds
I want to use Google News to trigger aws lambda function.

Can i do this using google news RSS feeds or is there any other way to achieve this?

答:
I want to use Google News to trigger AWS Lambda function.

This is not directly possible since there are not any native triggers for Lambda from Google News. As an alternative approach you can use a Lambda Scheduled Event to poll for the Google News Feed and process.


问:
Defining day between 18:00 and 18:00 next day
I want to have a query identify each day from 18:00 the previous day, up until 18:00 the current day, this is a 24 hour period and then group transactions by that amount.

The general Idea is to make a query align with a banking End of Day report, which does not run on a natural day, rather this 18:00 to 18:00 day.

I am new to MySQL and am wondering if there is a use of interval or a date function that could simplify this query, or what the recommended approach would be.

Here is a snippet of the current query that groups on the entire date (midnight to midnight).  I am looking for a function that might replace DATE_FORMAT in the group by clause.

```<code>SELECT DATE_FORMAT(totals.created_at,"%D %M %Y") as 'Date', warehouse.title ,sum(grand_total)
FROM totals
Join warehouse on warehouse.warehouse_id = totals.stock_id
WHERE
totals.created_at BETWEEN (NOW() - INTERVAL 21 DAY) AND NOW()
GROUP BY  totals.stock_id, DATE_FORMAT(totals.created_at, "%Y-%m-%d")
ORDER BY totals.created_at,warehouse.title
</code>```

答:
So I ended up using a simple test to then add a day to the date, using the following.</p>

```<code>DATE_ADD(totals.created_at, INTERVAL CAST(time(totals.created_at) > time("18:00") AS SIGNED INTEGER) DAY )
</code>```

Body:
I want to have a query identify each day from 18:00 the previous day, up until 18:00 the current day, this is a 24 hour period and then group transactions by that amount.

The general Idea is to make a query align with a banking End of Day report, which does not run on a natural day, rather this 18:00 to 18:00 day.

I am new to MySQL and am wondering if there is a use of interval or a date function that could simplify this query, or what the recommended approach would be.

Here is a snippet of the current query that groups on the entire date (midnight to midnight).  I am looking for a function that might replace DATE_FORMAT in the group by clause.

SELECT DATE_FORMAT(totals.created_at,"%D %M %Y") as 'Date', warehouse.title ,sum(grand_total)
FROM totals
Join warehouse on warehouse.warehouse_id = totals.stock_id
WHERE
totals.created_at BETWEEN (NOW() - INTERVAL 21 DAY) AND NOW()
GROUP BY  totals.stock_id, DATE_FORMAT(totals.created_at, "%Y-%m-%d")
ORDER BY totals.created_at,warehouse.title

Body:
So I ended up using a simple test to then add a day to the date, using the following.

DATE_ADD(totals.created_at, INTERVAL CAST(time(totals.created_at) > time("18:00") AS SIGNED INTEGER) DAY )