HST ADDON MODULE SUPPORT - WORK INCORRECTLY????

64 views
Skip to first unread message

Denis K

unread,
Nov 28, 2014, 5:20:09 AM11/28/14
to hippo-c...@googlegroups.com
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 ! 

Woonsan Ko

unread,
Nov 28, 2014, 3:45:46 PM11/28/14
to hippo-c...@googlegroups.com

Hi Denis,

It's very unfortunate that you can't make it work easily.
Would it be an idea if you publish your test project in github or somewhere downloadable?
Then I guess we can find the missing piece more easily..

Woonsan
(Sent via my mobile device. Apologies for any typos.)
   

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

Denis K

unread,
Nov 30, 2014, 4:21:44 PM11/30/14
to hippo-c...@googlegroups.com

Hi Woonsan. Thanks for reply! I Make new project and make it. 
пятница, 28 ноября 2014 г., 23:45:46 UTC+3 пользователь w.ko написал:
Reply all
Reply to author
Forward
0 new messages