Guidance on integrating CE gradually

10 views
Skip to first unread message

GregL

unread,
Oct 20, 2009, 10:55:11 AM10/20/09
to CommunityEngine
I have an existing site, done as a hobby of mine, and I'm hoping I can
expand its features greatly with CE. But I already have my own hand-
written versions of authentication and friends. I have not worked with
Engines before, and so I don't really get how the integration will
take place. Is it as simple as making sure my User model responds to a
few methods CE is calling, so that I can continue to provide the
functionality I already wrote? Is this documented, since knowing me it
will be slow and laborious even with documentation :)

Oh and, I'm especially hoping that after I integrate CE, I can also
make use of the facebook connect features, which I had embarked on
myself already, but sort of stalled. Can I still use the FB plugin for
CE if I provide my own authentication logic?

Thanks for providing this exciting engine, and for your help!

Bruno Bornsztein

unread,
Oct 22, 2009, 9:23:34 AM10/22/09
to communi...@googlegroups.com
Is this documented, since knowing me it
will be slow and laborious even with documentation :)

Unfortunately, no (documentation is still a sore spot for CE). Basically, the Desert plugin (which CE requires) will take CE's user model and mix in methods from your user model (overriding any duplicates; yours take precedence).

CE's authentication is just based on restful_authentication (and before that, acts_as_authenticated). The edge branch is now using authlogic. I'd recommend using CE's authentication and user model, and then just adding your app-specific user methods in your user.rb.
 
Oh and, I'm especially hoping that after I integrate CE, I can also
make use of the facebook connect features, which I had embarked on
myself already, but sort of stalled. Can I still use the FB plugin for
CE if I provide my own authentication logic?

 
Nope, CE_Facebooker depends on the authentication logic provided with the default CE distribution. 

GregL

unread,
Oct 22, 2009, 10:48:48 PM10/22/09
to CommunityEngine
On Oct 22, 9:23 am, Bruno Bornsztein <bruno.bornszt...@gmail.com>
wrote:
> CE's authentication is just based on restful_authentication (and before
> that, acts_as_authenticated). The edge branch is now using authlogic. I'd
> recommend using CE's authentication and user model, and then just adding
> your app-specific user methods in your user.rb.
>
> > Oh and, I'm especially hoping that after I integrate CE, I can also
> > make use of the facebook connect features, which I had embarked on
> > myself already, but sort of stalled. Can I still use the FB plugin for
> > CE if I provide my own authentication logic?
>
> Nope, CE_Facebooker depends on the authentication logic provided with the
> default CE distribution.

OK, thank you for this info. I'll take a close look at both the user
models and see if I think I can adapt my app. My authentication logic
is crap anyway, so probably this would pay off in more than one way.

GregL

unread,
Oct 29, 2009, 1:28:57 PM10/29/09
to CommunityEngine
Just to update anyone who was reading this thread, I'm having great
success so far.

Instead of integrating CE with my authentication method, I simply
imported my old users table into CE's and eliminated my code. Since I
wasn't using salt, I kept it blank and overrode the encrypt_password
and self.encrypt methods of User to ignore salt. Before I launch I
will improve my overrides to begin to migrate folks to use salt upon
their first login to the site. When some time has passed, I can drop
my overrides.

I also learned that all my old controllers must be changed to inherit
from BaseController. When I did that, many of my old pages came to
life.

I decided not to migrate my friends data from my existing concept of
friendship, and rather have everyone re-initiate friendships with each
other after I (re)launch. The reason is that CE's model is a bit
richer, since it contains information about which user initiated the
friendship. Rather than impose my own algorithmic choice there, I'll
let the users recreate things. I don't have a lot of users anyway, and
many of them have no friends, so they don't have a lot of work to do.

I have two tasks to do next. First, I want the users page that lists
all users to become a page that lists only the friends. I don't want
my users to be able to browse all the site's users. Second, I must
integrate the activities unique to my site into the Event system,
since I had such a system and consider it very important to add the
activity to the overall feed. After those, I will more tightly
integrate my own data structures into the look and feel of the site to
make things seamless. Then I will tackle facebooker!

Thanks for a great opportunity to really expand the scope of my site!

Charles Hoffman

unread,
Nov 5, 2009, 9:27:25 AM11/5/09
to CommunityEngine
I'm in a similar situation as this, so I'm glad to have found this
thread. I have a few other questions, however:

* My project already uses restful_authentication with some
modifications for email activation of user accounts. Should CE be
able to integrate with this all right?

* Installation instructions for CE involve cloning the git repo. My
project is already under SVN; I take it I'll want to go the route of
downloading the tarball instead?

Bruno Bornsztein

unread,
Nov 5, 2009, 1:00:22 PM11/5/09
to communi...@googlegroups.com
>  * My project already uses restful_authentication with some
> modifications for email activation of user accounts.  Should CE be
> able to integrate with this all right?

That's right. The older versions of CE use restful_auth, the latest
version uses authlogic (but backwards compatibility is maintained).

>  * Installation instructions for CE involve cloning the git repo.  My
> project is already under SVN; I take it I'll want to go the route of
> downloading the tarball instead?

Right again. If someone wants to set up an SVN mirror of my branch,
that's cool too.

Thanks!
Bruno

>
> >
>

Charles Hoffman

unread,
Nov 5, 2009, 1:48:59 PM11/5/09
to CommunityEngine
Thanks Bruno. I've got some new questions... I'm having some issues
that seem like they arise from conflicts between plugins that are in
CE and the same plugins that were already in the app:

* CE's migrations won't run because we're already using
acts_as_taggable_on_steroids and hence already have a tags table

* Ziya seems to be getting initialized twice, we're using the gem
already. I get a lot of warnings when the app starts up about
constants being redefined, followed by crashing with an error about
trying to call a private method (Ziya::Module#initialize?) I can get
rid of the error, but not the warnings, if I list :ziya
before :community_engine in the config.plugins=

* When the app starts up, something seems to be copying a bunch of
files into public/plugin_assets/calendar_date_select. This is giving
me trouble because it's also copying .svn folders. For now, it's
causing a permissions error and I have to just go delete all the .svn
folders and try again, but I have a feeling it will cause bigger
problems once I add public/plugin_assets into the project's svn repo.

Can/should I disable these various plugins within CE in favor of the
plugins/gems we were already using?

Bruno Bornsztein

unread,
Nov 10, 2009, 1:44:48 PM11/10/09
to communi...@googlegroups.com
 * When the app starts up, something seems to be copying a bunch of
files into public/plugin_assets/calendar_date_select.  This is giving
me trouble because it's also copying .svn folders.  For now, it's
causing a permissions error and I have to just go delete all the .svn
folders and try again, but I have a feeling it will cause bigger
problems once I add public/plugin_assets into the project's svn repo.

In your development or production.rb, put:

config.after_initialize do
  EnginesHelper.autoload_assets = false
end
 
Note that that will stop CE from copying its assets (stylesheets, etc) into your app, so you'll have to do it manually and add them to your SCM.


Can/should I disable these various plugins within CE in favor of the
plugins/gems we were already using?

There's no easy way to 'disable' plugins within CE. You could hack the CE source (i.e. remove taggable from CE's plugins directory), but you might cause a bunch of new errors.

 
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CommunityEngine" group.
To post to this group, send email to communi...@googlegroups.com
To unsubscribe from this group, send email to communityengi...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply all
Reply to author
Forward
0 new messages