CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Getting a trivial component to work
Pages: [1]

Author Topic: Getting a trivial component to work  (Read 1166 times)

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Getting a trivial component to work
February 09, 2009, 12:50:49 pm
Lobo's just implemented a new hook to add "search tasks" to the popup on the contact search page.  While I was looking into how to do this (before Lobo had done this)  I noticed that a CiviCRM component _should_ be able to do this.

I got it to work, but I had to fix some problems with how components work right now in the 2.2 tree.  The key piece is getting the getActivityType() method of the component interface implemented.

I'm attaching a sample implementation.  It's missing the implementation of the form itself, but since Lobo made this redundant, no serious deficiency.  But since components are good for other things, it's a start.

BTW: it would be good if components could be made "self registering".  The required change to the DB is small, and this only needs to be checked when someone is activating or deactivating components.  Why not have a small file (similar to the .info files in Drupal) that can be searched for by CiviCRM when the "Enable Components" page is rendered?  This would allow for deployment of components by people that don't feel comfortable running a raw bit of SQL.


Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Getting a trivial component to work
February 09, 2009, 02:33:26 pm
+1 for dynamic registering of components.

With the rapidly expanding codebase (CiviCase, WYSIWYGs, CiviAuction? CiviPhoneBank?) it would be a good thing, IMO, to compartmentalize more of CiviCRM, and make some components available as separate downloads, so that when we don't need it all, we can run a faster, lighter CiviCRM.
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

MichaƂ Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Getting a trivial component to work
February 13, 2009, 01:39:23 am
Hey,

Rob - thanks for your implementation. I will take a look at it shortly and try to introduce into the codebase. One change I'm thinking of is introducing new method in component integration layer (since getActivityTypes has been originally planned for something else. The idea behind it was to allow component to plug in into core Activities and provide their own activity types with their own specific ways of handling them. Since there was no real need for this, it has been left unimplemented. For upcoming versions, we have a reason to come back to this concept, since CiviCase is making heavy use of activities, so we might end up coming back to the concept of dynamically registering activity types.

Also, when it comes to dynamic component registration - components concept has been made ready for this at the beginning, but since there was no real need for this back when componentisation was introduced, I didn't implement it. I've added the issue to the issue tracker (CRM-4128) and will discuss with Lobo on scheduling it (it's on 2.3 for now).
 
Matt - yes, we are planning to move forward with componentisation/modularisation of CiviCRM, and actually the next planned step is to make components separately installable.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Getting a trivial component to work

This forum was archived on 2017-11-26.