AppFuse
  1. AppFuse
  2. APF-267

Add search feature to list screen generation

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.1.0
    • Component/s: Tools - AppGen
    • Labels:
      None

      Activity

      Hide
      Matt Raible added a comment -

      2.1 is when we plan to add Compass integration.

      Show
      Matt Raible added a comment - 2.1 is when we plan to add Compass integration.
      Hide
      Franz Allan Valencia See added a comment -

      Good day

      In addition to [1] and [2], [3] seems to be a pretty good appfuse + compass tutorial.

      [1] and [2] uses appfuse 1.x while [3] uses appfuse 2.0.

      Also, I've been playing around with appfuse-2.0 + jpa ( hibernate-entitymanager-3.3.1 ) + compass-1.2 but I've ran into a problem ( see [4] )

      Cheers,
      Franz

      [1] http://www.nabble.com/search---integrate-compass-%28lucene%29-and-appfuse-p5022176s2369.html
      [2] http://www.nabble.com/RE%3A-search---integrate-compass-%28lucene%29-and-appfuse-p5222253s2369.html
      [3] http://www.nabble.com/Integrating-Appfuse-2.0-and-Compass-tf3877365s2369.html#a10986902
      [4] http://forums.opensymphony.com/thread.jspa?messageID=225530

      Show
      Franz Allan Valencia See added a comment - Good day In addition to [1] and [2] , [3] seems to be a pretty good appfuse + compass tutorial. [1] and [2] uses appfuse 1.x while [3] uses appfuse 2.0. Also, I've been playing around with appfuse-2.0 + jpa ( hibernate-entitymanager-3.3.1 ) + compass-1.2 but I've ran into a problem ( see [4] ) Cheers, Franz [1] http://www.nabble.com/search---integrate-compass-%28lucene%29-and-appfuse-p5022176s2369.html [2] http://www.nabble.com/RE%3A-search---integrate-compass-%28lucene%29-and-appfuse-p5222253s2369.html [3] http://www.nabble.com/Integrating-Appfuse-2.0-and-Compass-tf3877365s2369.html#a10986902 [4] http://forums.opensymphony.com/thread.jspa?messageID=225530
      Hide
      Franz Allan Valencia See added a comment -

      Good day,

      Curious, what is the plan for this?

      Will this be added on the Dao side? Manager side? Will this use Compass annotations or xml config?

      Thanks,
      Franz

      Show
      Franz Allan Valencia See added a comment - Good day, Curious, what is the plan for this? Will this be added on the Dao side? Manager side? Will this use Compass annotations or xml config? Thanks, Franz
      Hide
      Matt Raible added a comment -

      Franz - I would suggest asking these questions on the user mailing list. That way, we can discuss among all of AppFuse's users and see what they think the best approach is.

      Show
      Matt Raible added a comment - Franz - I would suggest asking these questions on the user mailing list. That way, we can discuss among all of AppFuse's users and see what they think the best approach is.
      Hide
      Franz Allan Valencia See added a comment -

      @Matt: Thanks for the quick reply and for the suggestion

      @Everybody: I made a post in the Appfuse User mailing list about this ( see [1] ).

      Thanks,
      Franz

      [1] http://www.nabble.com/How-should-Compass-be-integrated-with-Appfuse-2.x-tf4872943s2369.html

      Show
      Franz Allan Valencia See added a comment - @Matt: Thanks for the quick reply and for the suggestion @Everybody: I made a post in the Appfuse User mailing list about this ( see [1] ). Thanks, Franz [1] http://www.nabble.com/How-should-Compass-be-integrated-with-Appfuse-2.x-tf4872943s2369.html
      Hide
      Matt Raible added a comment -

      Here's a tutorial on how to integrate Compass:

      http://code.google.com/p/pagingappfuse/wiki/CompassSearching

      Show
      Matt Raible added a comment - Here's a tutorial on how to integrate Compass: http://code.google.com/p/pagingappfuse/wiki/CompassSearching
      Hide
      Matt Raible added a comment -

      Patch from Shay Banon - founder of Compass. Here's the message included in the patch Shay sent:


      I spent some time integrating Compass to the Appfuse DAO layer. I am attaching a patch that basically integrates with the Hibernate, JPA, and iBatis DAO implementations allowing to automatically mirror changes done through the DAO to the index, as well as performing full index operation (though Compass beans).

      I have chosen to index the User object (with Address as component), which seems like it make sense. You can check the changes I made to the pom files and the dao xml files. Also, I needed to upgrade iBatis to its latest version so Compass can work with it.

      I think that what is left to be done now is simply integrating search into the different view layers. I am no expert in it (I basically know Spring MVC, and in a superficial manner). I think it will be much faster for you to do that. I suggest creating a simple search action that uses the CompassSearchHelper.

      If you want, we can also enhance the service layer to include a search service, though I am not sure if it is needed for the first go.

      A quick breakdown of enabling search:

      1. Added Searchable annotations to the User and Address.
      2. Defined Compass bean, automatically scanning the model package for mapped searchable classes. It also automatically integrates with Spring transaction manager, and stores the index on the file system ([work dir]/target/test-index).
      3. Defined CompassTemplate (similar in concept to HibernateTemplate).
      4. Defined CompassSearchHelper. Really helps to perform search since it does pagination and so on.
      5. Defined CompassGps, basically it allows for index operation allowing to completely reindex the data from the database. JPA and Hiberante also automatically mirror changes done through their API to the index. iBatis uses AOP.

      I don't know if you want to create search.properties file or not. But if you want, it can easily be created and have Compass read it within the definition of the Compass bean.

      Cheers,
      Shay


      Thanks Shay!

      Show
      Matt Raible added a comment - Patch from Shay Banon - founder of Compass. Here's the message included in the patch Shay sent: I spent some time integrating Compass to the Appfuse DAO layer. I am attaching a patch that basically integrates with the Hibernate, JPA, and iBatis DAO implementations allowing to automatically mirror changes done through the DAO to the index, as well as performing full index operation (though Compass beans). I have chosen to index the User object (with Address as component), which seems like it make sense. You can check the changes I made to the pom files and the dao xml files. Also, I needed to upgrade iBatis to its latest version so Compass can work with it. I think that what is left to be done now is simply integrating search into the different view layers. I am no expert in it (I basically know Spring MVC, and in a superficial manner). I think it will be much faster for you to do that. I suggest creating a simple search action that uses the CompassSearchHelper. If you want, we can also enhance the service layer to include a search service, though I am not sure if it is needed for the first go. A quick breakdown of enabling search: 1. Added Searchable annotations to the User and Address. 2. Defined Compass bean, automatically scanning the model package for mapped searchable classes. It also automatically integrates with Spring transaction manager, and stores the index on the file system ( [work dir] /target/test-index). 3. Defined CompassTemplate (similar in concept to HibernateTemplate). 4. Defined CompassSearchHelper. Really helps to perform search since it does pagination and so on. 5. Defined CompassGps, basically it allows for index operation allowing to completely reindex the data from the database. JPA and Hiberante also automatically mirror changes done through their API to the index. iBatis uses AOP. I don't know if you want to create search.properties file or not. But if you want, it can easily be created and have Compass read it within the definition of the Compass bean. Cheers, Shay Thanks Shay!
      Hide
      Matt Raible added a comment -

      Need to add the following to AppFuse Repo on oss.sonatype.org:

      <repositories>
      <repository>
      <id>compass-project.org</id>
      <name>Compass</name>
      <url>http://repo.compass-project.org</url>
      </repository>
      </repositories>

      Also, need to add front-end functionality to talk to Compass. Would be great to have indexes available as a RESTful service that a web framework or Ajax could call.

      Show
      Matt Raible added a comment - Need to add the following to AppFuse Repo on oss.sonatype.org: <repositories> <repository> <id>compass-project.org</id> <name>Compass</name> <url> http://repo.compass-project.org </url> </repository> </repositories> Also, need to add front-end functionality to talk to Compass. Would be great to have indexes available as a RESTful service that a web framework or Ajax could call.
      Show
      Matt Raible added a comment - http://raibledesigns.com/rd/entry/adding_search_to_appfuse

        People

        • Assignee:
          Matt Raible
          Reporter:
          Matt Raible
        • Votes:
          4 Vote for this issue
          Watchers:
          6 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development