[wip] TYPO3 + G2

Akari

Joined: 2005-06-19
Posts: 3
Posted: Sun, 2005-06-19 15:56

It has to be done by someone and this might as well be me. Perhaps someone offers some G2 knowledge to help me with the port.

I have looked at the instructions and am not 100% sure what you want me to implement. One major problem is the absolute absence of hooks for user registration.

In the TYPO3 core a user is just a record in the table fe_users there is no mechanism that creates a user or removes her. The TYPO3 backend is just a general purpose database table editor supposed to edit an unlimited amount of tables. Also there is no user registration, no password lookup in the core. And this isn't a bug, it's by design.

Unlike a portal system like php-Nuke, TYPO is a real content management system and as thus not 100% perfect for a community website (believe me I know what I'm talking about ^.^)

There are a few extensions (or call them plug-ins if you like the word more) that allow a user registration, password lookup etc. I'm using plural extensions because there are plenty of them. After all it's not really hard to write one. If you had to add hooks you had to either support every single registration extension, or force users to use a certain one which is hacked to support hooks. Which is not something an admin who worked to get his own registration extension working would be eager to do.

However, in TYPO3 extending an already existing database with new fields is extremely easy. You can add as many user defined fields to the fe_users table as you like.

I know I'm very late to this ballgame, but I have worked alot with the forum system phpBB to get it running on TYPO3 3.7+ the major problem integrating a third party software is the user table, and how to keep them in sync.

I know only of three requirements of a third party software that could enable them to interact perfectly:

  • The CMS has to provide the following information: a unique user id, a unique username, and the information whether the user is logged on.
  • The CMS has to provide a way to store user data in the user database
  • The CMS has to provide an interface to store session information

Although the first one is enough to make it work already (unless "unique" user ID's are reused), the second is necessary to avoid the databases getting out of sync e.g. when a user is deleted in the "other" application, the user record still present in ours.

So what would you suggest?

~Akari[/]

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-06-19 16:10

Hi Akari.
Please go to http://typo3.org/documentation/mailing-lists/dev-list-archive/
and search for 'Staudacher'.
You'll find two dev mailinglist discussions about hooks etc.
The general answer is:
No, at the moment this is not available / possible in / with typo3, but we are planning to do something like that.

And xaraya (i'd call it a true CMS) has shown that hooks aren't something that you can expect from portals or so, it's just a very new concept, maybe newer than typo3.

I did also a lot of research on the topic of integrating a 3rd party application (G2, phpbb, ..) into another application (e.g. a cms, portal, ...).
We looked at tight integration (CMS and G2 share the same user table) and came to the conclusion that is possible but less maintainable, more involving than a loose integration.
We define a loose integration as a integration where typo3 tells G2 only the typo3UserId. And user information is stored in both applications, e.g. it needs to be synchronized.

Now we both know that typo3 can't synchronize user information exactly when it changes (create, update, delete).
This is the same situation as with most applications (same for mambo, *nuke, ...).

So the approach is a different one, until typo3 supports hooks.

Approach:
Create typo3 users in G2 on-the-fly.
Synchronize (Updated data / Deleted users) periodically.

also see:
docs/EMBEDDING
and the Embedding & Integration sticky topic.

 
Akari

Joined: 2005-06-19
Posts: 3
Posted: Sun, 2005-06-19 16:42
valiant wrote:
No, at the moment this is not available / possible in / with typo3, but we are planning to do something like that.

We already have hooks. As written in my first post we cannot use hooks in the user registration process because there is none.

valiant wrote:
And xaraya (i'd call it a true CMS) has shown that hooks aren't something that you can expect from portals or so, it's just a very new concept, maybe newer than typo3.

As said we have hooks since TYPO 3.6.0, you can check here
Even newer is the support of services described here

valiant wrote:
We looked at tight integration (CMS and G2 share the same user table) and came to the conclusion that is possible but less maintainable, more involving than a loose integration.

I'd like to have that explained. Why is maintaining two tables with the same information and two places of maintaining parts of these information more maintainable?

valiant wrote:
We define a loose integration [...] Now we both know that typo3 can't synchronize user information exactly when it changes (create, update, delete).

If they were to use the same database table (see my three requirements above) it is. It's just mambo and *nuke doesn't support this attempt because their user table structure is relatively static. Changing it means for most systems they're no longer able to use the update software delivered by the vendor.

valiant wrote:
Approach:
Create typo3 users in G2 on-the-fly.
Synchronize (Updated data / Deleted users) periodically.

Periodically... Not everybody has shell access to use cron jobs... and I dislike the idea of using a visitor to trigger such an evend because it slows down his access to the page... PHP is limited to 30 secs of execution... and when the user closes the connection the script *might* get stopped in the middle of execution...

Just my $0.02.

~Akari

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-06-19 17:11

I know that there are hooks, etc. but that doesn't help for the user creation/modification/deletion. See the typo3-dev mailinglist posts.

@php 30 secs limit:
PHP is not limited to 30 secs / request. That has to do with it's configuration and G2 augments this limit dynamically for long tasks.
But this has nothing to do with this. A page that needs more than 1 sec to process isn't userfriendly anyway and we're not talking about long processes here.

@periodic update of user information:
typo3 isn't the tool that is used by owners of lowcost / free webhosting (that's not the usual typo3 user). cron jobs are available for many quite cheap webhost plans.
and even without cron jobs, you can issue a synchronization by hitting on a admin button. and user data updates / user deletions are not frequent operations and mostly not crucial.
i know that this is a hacky solution, but the typo3 devs said they're planning on unifying this user creation/modification/deleation interactions such that a single hook would solve it. in the meantime you have to live with that.

@tight vs. loose integration:
i've explained this a couple of times, i really really should write it down somewhere. I don't remember all reasons. Most of it you can read up in the threads that are linked in the sticky Embedding & Integration topic. I guess i discussed this also in the mambo forums.
i tried this tight integration with G2/xaraya and i got it to a point where almost everything worked.
- I added on-the-fly database query translations such that G2 used the xaraya user table in place of the g2 user table. It also replaced G2 column names with xaraya user table column names. This includes SQL queries with joins etc.
- If different formats are used for the values in the db, you'd also have to translate the returned / inserted values on-the-fly.
- One of the main problems is that G2 uses the same source for IDs for all kinds of objects. GalleryUser, GalleryItem, GalleryAlbumItem, ... are all GalleryEntities and as such there's no GalleryItem with the same id as a GalleryUser.
If you create now a typo3 user with typo3 userId 17 and there's already a G2 GalleryAlbumItem with id 17, you've got a problem.
Of course you could solve that somehow, e.g. by changing the architecture of G2 or making an exception for the user class, not very elegant, but feasible.
- Requiring the other application to have a user table is a fairly good assumption, but still it's a restriction. It must also have a integer id column, which is not the case for all applications. etc. It's just quite restrictive.
- Adding columns to the user table maybe easy by design in typo3, but other CMS / portals may have other concepts (in most!). And other concepts don't have to be inferior, they are just different.
- Writing the SQL on-the-fly translation is quite involving. Also, the integration code suddenly depends on the inner architecture of both applications. What about abstraction etc.?
- And what about groups? Different CMS / portals manages groups in other ways. Most have the concept of flat groups. Other have recursive / tree groups.... Using a single table for groups for both apps maybe impossible.

@on-the-fly user creation:
on-the-fly user creation is something we recommend as a low-tech integration alternative.
we figured out a way where no additional db queries are necessary per request when using on-the-fly user creation. just look at the mambo or i guess also the wp integration.

 
rillest

Joined: 2003-10-20
Posts: 14
Posted: Sun, 2005-07-17 13:15

Any news on a possible integration?? ...the greatest CMS and the greatest gallery needs to be integrated!!!!
// big up to the great developers of both these great apps!
rILLEST

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-17 13:20

it's up to the typo3 devs. i'm not into typo3, let us know when they've implemented the things needed to call hooks for all create/update/delete user interactions in typo3.

 
Akari

Joined: 2005-06-19
Posts: 3
Posted: Thu, 2005-08-18 16:24

I have found that Gallery 2 in it's current state is not suitable to be ported to TYPO3 due to incompatibilities with their framework and I'm not happy to write a software that's completely made of workarounds. An authentication system like this would have saved alot of trouble in that department.

~Akari

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-08-18 22:11

Akari, sure, we can play the ball back and forth. but typo3 isn't ready for integration (either).
if you could point out the shortcomings of g2, we could discuss how to improve it.

 
blocparty

Joined: 2005-09-02
Posts: 1
Posted: Fri, 2005-09-02 12:24

Hi!

We are running a project (http://seecom.at) using G1 @ the moment. Anyway, the gallery now seems to have to handle more pictures than it should. We are developing some stuff at the moment and therefore would like to switch to G2. But we need the typo3 user support. So is there any progress made at the moment? Have things become better with the latest release of G2? We will have a look ourselves but would be glad for support. greetings

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-09-02 12:28

blocparty, nope, there was no further typo3 / g2 development to my knowledge. also, we (g2) are still waiting for typo3 to include the promised changes in typo3.

 
ryanoff

Joined: 2005-11-06
Posts: 1
Posted: Sun, 2005-11-06 16:21

blocparty, any chance you can breifly explain how you currently integrated G1 with Typo3? I am trying to get a soft integration of G2 with Typo3, but due to my lack of Typo3 experience I am having trouble. I am guessing there is a way to just wrap G2 with in a Typo3 page with no user interaction and probably even having gallery reside in a seperate database. Is this easily possible. I am about to upgrade an old gallery/mambo site to Typo3/G2. Thanks. Ryan

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-11-06 16:24

ryanoff

currently, there's a German user working on the G2/typo3 integration.
see the internation zone -> german forum.

 
dardoz

Joined: 2005-12-09
Posts: 1
Posted: Fri, 2005-12-09 14:12

Hi.

I'm trying to integrate G2 with Typo3 3.8.1

Are there any further developments with this?

Dardoz

 
lavitto

Joined: 2006-07-25
Posts: 3
Posted: Mon, 2006-08-21 12:37