i investigation trunk from svn with linear-algebra example
The base Addon example from site do't working please help with it !
I am install maven artifact with hippo essentials from scratch
i pull from it next maven folder structure, to there i am added my addonmodule
+boostrap
+cms
+conf
+essentials
+site
+src
-addonmodule
-main
-java
-com.mygroup.addon.modules.PrintOperator.java
-resources
-META-INF/hst-assembly/addon
-com.mymodule.addon.modules
base.xml
-solrmodule
solr.xml
module.xml
pom.xml [included <dependency>
<groupId>org.onehippo.cms7.hst</groupId>
<artifactId>hst-solr-client</artifactId>
<version>${hippo.hst.version}</version>
</dependency>
<dependency>
<groupId>org.onehippo.cms7.hst</groupId>
<artifactId>hst-solr-content-beans</artifactId>
<version>2.28.06</version>
</dependency>
1. i am create package com.mygroup.addon.modules in my addon module with bean PrintOperator.java with code
public class PrintOperator {
private static final Logger log = LoggerFactory.getLogger(PrintOperator.class);
private String bean;
public PrintOperator(String s) {
this.bean = s;
}
public PrintOperator () {
};
public String getBean() {
return bean;
}
public void setBean(String bean) {
this.bean = bean;
}
public double multiple(int a) {
return a;
}
}
2. add descriptors from guide on official documentation
2.1 module.xml
<?xml version="1.0" encoding="UTF-8"?>
<name>com.mygroup.addon.modules</name>
<config-locations>
<config-location>classpath*:META-INF/hst-assembly/addon/com.mygroup.addon.modules/*.xml</config-location>
</config-locations>
<modules>
<module>
<name>solrmodule</name>
<config-locations>
<config-location>
classpath*:META-INF/hst-assembly/addon/com.mygroup.addon.modules/solrmodule/*.xml
</config-location>
</config-locations>
</module>
</modules>
</module>
2.2 base.xml
<?xml version="1.0" encoding="UTF-8"?>
<bean id="printOperator" class="com.mygroup.addon.modules.PrintOperator">
</bean>
</beans>
2.3 solr.xml
<?xml version="1.0" encoding="UTF-8"?>
<bean id="org.hippoecm.hst.solr.HippoSolrClient" class="org.hippoecm.hst.solr.HippoSolrClientImpl">
<property name="solrUrl" value="${solr.url}"/>
</bean>
</beans>
3. i am add to root pom.xml new module to profile section within tag modules <module>addonmdule</module>
4. i am add to site pom.xml dependency about my module addon
<dependency>
<groupId>org.example</groupId>
<artifactId>my-hippo-addon</artifactId>
<version>1.01.00-SNAPSHOT</version>
</dependency>
3. i make site component controller within package named org.example.components.FacetedRightNavigationList.java
with next code
public class FacetedRightNavigationList extends BaseHstComponent {
@Override
public void doBeforeRender(HstRequest request, HstResponse response) throws HstComponentException {
PrintOperator operator = HstServices.getComponentManager().getComponent("printOperator","com.mygroup.addon.modules");
HippoSolrClient solrClient = HstServices.getComponentManager().getComponent(HippoSolrClient.class.getName(), "com.mygroup.addon.modules");
request.setAttribute("operator",operator);
System.out.println("I am check my component");
}
}
4. On JCR i makes all needed nodes to have component with name test that invoke my controller FacetedRightNavigationList [it work good, on front-end i see my default text from test.ftl script node]
5. And after build and run my application i debug my controller but operator = null
I am newly on hippo and java, maven and spring!!! Who can get me answer that i am doing wrong, why my bean name is null
i am not install any dependency and plugin !