CMS Integration
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Danny, the error from yesterday (navigationLocale) is fixed in my dev version (not online, because I'm working on the search hook too). |
|
Danny
Joined: 2003-03-24
Posts: 90 |
![]() |
Valiant, thanks for your help. I test your new version as soon as it is out. About logging. The directory var/logs must be writable and a file called log.txt (also writable) must be present. When you have the LogConfig Module installed, you can finetune the logger options, what is being logged. Danny |
|
Danny
Joined: 2003-03-24
Posts: 90 |
![]() |
Valiant, I started a Bug Report about Xaraya behaviour with the Gallery2 Modul under http://bugs.xaraya.com/show_bug.cgi?id=3834 It would be good, if you have a look at the Bug and give your expertise. Thanks, Danny |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
mindless, somethings that all integrations still need: - solution for css interferences: put G2 html in a container (<div>) or something and the css experts should identify everything so that nothing outside this container gets affected by G2 css - menu links method (spiderr could work on this) |
|
mindless
![]()
Joined: 2004-01-04
Posts: 8601 |
![]() |
the container div (id="gallery") already exists.. the css just doesn't use it. I agree it should. |
|
Danny
Joined: 2003-03-24
Posts: 90 |
![]() |
Thanks for the new release. The errors where gone. It will be good, if there is an option to disable the description title like "Random Image" or "Most viewed pictures". It would be good, if there is an config option, to center the pictures in the image block "Random Image" or "Most viewed Image". Danny |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Danny, AFAIK there's an option to disable the title in the image block "heading" or something like that in the instance config. mindless, I guess I need the image block without precompiled HTML, just the vars: thumb download url, fullsize download url, fullsize showitem url, titile, date, ... = unrendered imageblock. thanks - Andy |
|
Danny
Joined: 2003-03-24
Posts: 90 |
![]() |
Valiant, yes under Blocks->Show Instances->Image Block is a checkbox to disable the Heading. But with my Xaraya Installation it is not working. Whenever I disable Heading and press "Update Config" nothing changes in my Image Block and also "Heading" is activated. Very strange. Is it working in your installation? I use your Gallery2 Module which you released 09.1.2005. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Danny, very probably my fault, gonna correct it when i'm at home. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Danny, fixed. |
|
Danny
Joined: 2003-03-24
Posts: 90 |
![]() |
Thousand thanks, it works! |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
i committed the xaraya integration to the G2 cvs and fixed the "public site" bug. It should work now with all kinds of xaraya sites. |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
Hey, I love your work here. When I try to install your Gallery2 module in Xaraya 0.9.11 I get the error indicating I need to update Gallery to version .8.8 (now .8.6). So my question is: Keep the good work up! |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
michelv, xaraya 0.9.11, G2 current cvs (.8.8). |
|
DrBob
![]()
Joined: 2005-01-09
Posts: 20 |
![]() |
Just a small question: I know you are all mainly busy with integration in xaraya but do you know if any work has been done/started to integrate G2 into Mambo ? I'm really in a desperate need of this integration (even if G2 is still in alpha). I know some posts were done on the Mambo forum asking for developers but it seems nobody replied. (If I had any notion of PHP, I would gladly start coding myself). Kind regards, |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
DrBob, AFAIK there has been zero progress concerning a mambo integration, sorry. And we don't have any mambo knowledge or the time to start another integration at the moment. You'll have to find someone who does the work for you. |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
I have Gallery CVS now integrated into Xaraya .9.11. I have coupled some dynamic data to the roles module.. so when adding a user he has some dynamic data. When adding a user it all works great. When deleting him then I get: Failed to change G2 password to a random password during xaraya delete role process of role with extId [13]! De functie is correct uitgevoerd, maar het resultaat is mislukt. (=function worked, but result failed) at _gallery2_adminapi_deleterolehook(deletehook.php:115) If you want I can mail the complete error. Michel |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
deletion of users is still experimental due to xaraya incompatiblity. |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
I have three new methods on my desktop for proposal to embed.php. - getSyncMap(), Get map for syncing by mapping type. - addSyncMapEntry(), Adds an entry for the map used for syncing. - setProperty(), Set property for configure the way integration/embedding is done. How about testacases. Does GalleryEmbed has it's own? The code. I haven't tested it even yet. What do you think? /** * Get map for syncing by mapping type. * * @param string the id ('entityId' or 'externalId') used as key for the returned array * @return array(object GallerySuccess, array(Id => array(externalId => integer, * entityId => integer, entityType => string))) */ function getSyncMap($key) { $query = 'SELECT [ExternalIdMap::entityId], [ExternalIdMap::externalId], [ExternalIdMap::entityType] FROM [ExternalIdMap]'; list ($ret, $results) = $gallery->search($query, array()); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } $map = array(); while ($result = $results->nextResult()) { $entry = array('externalId' => $result[1], 'entityId' => $result[0], 'entityType' => $result[2]); if ($type == 'externalId') { $map[$result[0]] = $entry; } else if ($type == 'entityId') { $map[$result[1]] = $entry; } } return array(GalleryStatus::success(), $map); } /** * Adds an entry for the map used for syncing. * * @access public * @param integer the externalId * @param integer the entityId * @param string the roles type, 'GalleryGroup' for groups, 'GalleryUser' for users * @return object GalleryStatus */ function addSyncMapEntry($externalId, $entityId, $entityType) { $ret = ExternalIdMap::addMapEntry(array('externalId' => $externalId, 'entityType' => $entityType, 'entityId' => $entityId)); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } return GalleryStatus::success(); } /** * Set property for configure the way integration/embedding is done. * Valid keys are: showSidebar, showPathbar * * @access public * @param the key for the property * @param the value for the property * @return object GalleryStatus */ function setProperty($key, $value) { $ret = GalleryCapabilities::set($key, $value); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } return GalleryStatus::success(); } |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
While i agree in principle to add methods similar to the first two functions, I''m not sure what you gain with the 3rd function. @the sync map methods: |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
valiant wrote:
I''m not sure what you gain with the 3rd function. Only for collecting all embedding methods in one place. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
@ function addSyncMapEntry: - Are you sure that it works without including the ExternalIdMap.class before? - Using "GalleryGroup" and "GalleryUser" instead of 1 and 0 makes good sense @ function getSyncMap: - could you elaborate why returning one map is better than both maps? In what specific case? I mean, if the mapping is obsolete due to modifications as addexternalidmap, both arrays will be obsolete and need to be updated. so why does it matter if you return the map sorted by externalId and entityId instead of only one of them? - this functions needs to be in embed.php, i absolutely agree |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
good news on the xaraya front. the status of xaraya bug 3535 has been changed to a xaraya 1.0 blocker. that means that i get my delete/create events (hooks) in xaraya, when a user/group gets deleted/purged/recalled. |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
valiant wrote:
- Are you sure that it works without including the ExternalIdMap.class before? I hadn't even tested the code ... I prefer solving the problems on a theoretical level before I start debugging. I usually write for many days code without testing it. ;) valiant wrote:
- could you elaborate why returning one map is better than both maps? In what specific case? I mean, if the mapping is obsolete due to modifications as addexternalidmap, both arrays will be obsolete and need to be updated. so why does it matter if you return the map sorted by externalId and entityId instead of only one of them? You have a two sets of users. The intersection of the two sets are users that are registerd into both EmApp and G2. Now you iterate through G2 users. Update the set of intersection users that are known in both G2 and EmApp. You update the ExternalMap to flag that this is done. Later you iterate through EmApp users ... you handle only those that are not in the the ExternalMap. Otherwise the set of intersection users will be synced twice. Between these two iterations you have to read the ExternalMap again to be able to handle these intersection users. Is the explanition enough? I can do it purely mathematicly if you want ;) |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
EmAppUsers = {List of EmApp Users} These lists are stored in the databases. Algorithm: (01) Get cached Lists of EmAppUsers, G2Users and Map denoted as EmAppUsers_cache, G2Users_cache and Map_cache respectively; (02) For each g2User in G2Users_cache do (03) if g2User NOT in Map_cache then (04) Create User in EmApp with user data from g2User; (05) Insert new mapping into Map; (06) Insert new mapping into Map_cache; (07) end if; (08) end for; (09) For each emAppUser in EmAppUsers_cache do (10) if emAppUser NOT in Map_cache then (11) Create User in G2 with user data from emAppUser; (12) Insert new mapping into Map; (13) else (14) Update User in G2 with user data from emAppUser; (15) end if; (16) end for; My point is as follows: Note: (11) and (12) can be done with a single method call from GalleryEmbed. I still don't understand why having two copies of a cached version of Map is worse than having only one as you propose. |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
Eiher way, refresh between line 8 and 9 or using a Map_cache. If you do the refresh between 8 and 9 you need only one list at a time. So you use the second map as a cache. I like your cached solution, but it's slightly complicated then a refresh. The cached solution is faster. But you have only to do it once. So it doesn't really mater. This cache may confuse developers. Is this algorithm the way it's done in Xaraya? |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Einstein, ah I see what you mean. Right. For the first iteration only Map by entityId is needed and for the second iteration Map by externalId. Ok, then I agree with your proposal of the function, only 1 list is needed per iteration. (01) Get cached lists of EmAppUsers, G2Users and Map by entityId denoted as EmAppUsers_cache, G2Users_cache and Map_by_entityId_cache respectively; (02) For each g2User in G2Users_cache do (03) if g2User NOT in Map_by_entityId_cache then (04) Create User in EmApp with user data from g2User; (05) Insert new mapping into Map; (06) end if; (07) end for; (08) Get cached list of Map by externalId Map_by_externalId_cache; (09) For each emAppUser in EmAppUsers_cache do (10) if emAppUser NOT in Map_by_externalId_cache then (11) Create User in G2 with user data from emAppUser; (12) Insert new mapping into Map; (13) else (14) Update User in G2 with user data from emAppUser; (15) end if; (16) end for;
PS: This is the way I did it in xaraya. Well, I get the Map always for both both Map_caches, but basically it's the same. |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
valiant wrote:
Here's the slightly modified algorithm, I'll add it to the docs (which don't exist at the moment) I don't get it, why you have the world cache in the latest algortihm. And secondly users in both userbases are missed? Or are they? Maybe we think a bit different ;) I think it like this, the "phpBB" way: (01) Get list of EmAppUsers; (02) Get list of G2Users; (03) Get ExternalIdMap by entityId; (04) For each G2User in G2Users do (05) if G2User NOT in ExternalIdMap then (06) if G2User NOT in EmAppUsers then (07) Create User in EmApp with user data from G2User; (08) else (09) Add EmAppUser to array of conflicts; (10) end if; (11) Insert new mapping into ExternalIdMap; (12) end if; (13) end for; (14) Get new ExternalIdMap by externalId; (15) For each EmAppUser in EmAppUsers do (16) if EmAppUser NOT in ExternalIdMap then (17) Create User in G2 with user data from EmAppUser; (18) Insert new mapping into ExternalIdMap; (19) end if; (20) end for; |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
Want to add that a conflict is where username same but password differ. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Quote:
I don't get it, why you have the world cache in the latest algortihm. At the very moment you query the db and put the result into an array in php, you acquired a cached state of the database. that's why i use the word cache. from the Level 1 cache, RAM, harddisk point of view, it's the same thing as a cache. Quote:
And secondly users in both userbases are missed? Or are they? Maybe we think a bit different. No, they are not. I didn't write the "conflicts" and all the various checks in the very rough code above, but you can easily add them. In my xaraya code, i handle "conflicts" immediately and don't push them on a conflicts list. I state very clearly what I do in the import/export code in my xaraya admin page. That conflicts are handled in a specific way. Quote:
Want to add that a conflict is where username same but password differ. Well, what I do is in line (14) of my code. Passwords in G2 get overwritten with the passwords from EmApp. |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
valiant wrote:
That's the scary thing ... usernames can be hijacked. Let's say you have SuperG2User in Gallery. For hijacking you register SuperG2User into EmApp. After the sync the second user have control over the first users Gallery information. I finally undertood your algorithm the "right way". It's not possible to do it your way by overwriting passwords, if you want to solve the conflicts. I leave the conflicts unmapped. After that you can run the sync again to get everything in order. |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
Can you commit those methods to CVS? |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
And your explanation why my way of resolving "conflicts" is incorrect is the "Superg2User" example? You can't call that hijacking. You know what happens during synchronization, you are in control of both applications. Just prepare the applications before the initial synchronzation. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
I added the two externalIdMap methods to GalleryEmbed. |
|
Einstein
![]()
Joined: 2003-10-13
Posts: 105 |
![]() |
valiant wrote:
And your explanation why my way of resolving "conflicts" is incorrect is the "Superg2User" example? You can't call that hijacking. You know what happens during synchronization, you are in control of both applications. Just prepare the applications before the initial synchronzation. But how do you know that a user with same username is the really the same user without checking the password? You don't know. Say we have two users ... both use username bill. The first one has a username only to gallery. The second bill has only a username to EmApp. With your way the "gallery bill" cannot get into your system anymore. Your way isn't incorrect .. but it can cause username problems if you integrate big userbases. valiant wrote:
I added the two externalIdMap methods to GalleryEmbed. That's OK ... but it's good to ducument what other objects can be of use in i integration. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
Einstein, i clearly declare that the initial mapping is based on user/group names. what else should be the map based on? we could feature a "conflicting users" page, true. but once the initial mapping process starts, the admin knows what is gonna happen, no surprises. |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
Hey, I have Xaraya snap 050220 running with the CVS version of Gallery 2 and the integration module. First, the config says: I already did the hooks, before going to the gallery config, so why this message? At some times, this message is skipped. Then, trying to synch the roles/users, I get: Functie ontbreekt. (Function missing) Failed to update special G2 group by extId [5]. Here is the error message from G2: <br /> [Error (GALLERY_SUCCESS)<UL><LI><B>in</B> <B>at line</B> 0</UL>] De functie is correct uitgevoerd, maar het resultaat is mislukt. (result failed) at g2updatespecialroles(xargallery2helper.php:1181) Array [product] => ) at gallery2_admin_updateconfig(updateconfig.php:82) Any idea where I should look to get it working again? Michel |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
versions: Quote:
First, the config says: Maybe you didn't hook everything. Don't know. Checking it later. Quote:
Failed to update special G2 group by extId [5]. Here is the error message from G2: <br /> [Error (GALLERY_SUCCESS)<UL><LI><B>in</B> <B>at line</B> 0</UL>] I have to investigate in this. I had something similar, thought it was related to postgres. Well, obviously it's not. What fixed it for me was to a) retry or b) delete all entries in db table g2_externalIdmap and retry. |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
Versions are all latest CVS, or maybe a few days older. I am noticing that Xaraya is getting stricter in dealing with all kinds of variables. In between 9.11 and now some things 'break'. I will try you suggestion of deleting g2_externalIdmap-entries Hooks: the readme says only roles is needed. I also hooked dynamic data, but that didn't solve anything. Thanks, |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
You don't need to hook anything manually, the admin->modify config view handles these things. |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
Deleted the entries in g2_externalIdmap, hit the button, received this error: Functie ontbreekt. Could not get extId for g2groupid [1]. De functie is correct uitgevoerd, maar het resultaat is mislukt. at g2xarusergroupimportexport(xargallery2helper.php:1500) Array [product] => ) at xarmodfunc(xarMod.php:871) Functie ontbreekt. Failed to create a extmap entry for role uid [24] and entityId [1], entityType [GalleryGroup]. Here is the error message from G2: <br /> De functie is correct uitgevoerd, maar het resultaat is mislukt. at g2addexternalmapentry(xargallery2helper.php:590) Array [product] => ) at gallery2_admin_updateconfig(updateconfig.php:82) Array at xarmodfunc(xarMod.php:871) The Gallery groups are updated, the gallery users not. Michel |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
after deletin the entries in g2_externalidmap, you have to resynchronize xaraya/g2 user/groups in xaraya admin menu->gallery2->modify config import tab. |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
Yes, the error is when I hit the sync button. So the synchronizing causes the error. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
@hooks: @versions: Please get the newest versions of everything and try again, thank you. |
|
elarkin
Joined: 2005-02-08
Posts: 18 |
![]() |
Valiant, Awsome work so far. Not sure if its me or not but I am having the same problem as above, I did figure out to comment out the G2 version section and did get modify config to work but when I synced users I got a ton of errors and gallery was no longer working. I use the current zip files of Xaraya and G2 and cvs'ed your integration into xaraya just yesterday, I do think I know what the problem is, I actually deleted the table and not the entries in it. this casued me to have to reinstall all of the G2. I re ran the module setup and then ran the sync users and get the same error, its the usergroup function that I am having problems with. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
elarkin, if you can give me access to your machine, i may be able to reproduce the bug and fix it. You pm / email me all usernames/passwords I need and tell me how much i'm allowed to delete (g2, xaraya). ps: the version check bug is fixed since 12+ hours. the anonymous cvs version is often very late, i.e. if i change something in cvs, you have to wait hours, maybe days to see the change in anonymous cvs. i just checked the anonymous cvs version of the integration module, it's up to date. please download it, the version check works fine now. and if you encounter errors during activation, please a) report the errors and b) let me access your box. thanks |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
Just to let you know: Failed to create a extmap entry for role uid [24] and entityId [1], entityType [GalleryGroup]. Here is the error message from G2: <br /> I have to think about you accessing my box... are we the only ones with this problem? Michel |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
michelv, my xaraya gallery2 module isn't official yet so there are not that many users. and you two are the only ones who have this error, probably because you are the only ones who installed it lately. |
|
michelv
Joined: 2005-01-20
Posts: 17 |
![]() |
mm, I cannot install the latest CVS of Gallery2. Version error. I'll try with the beta release. Michel |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
version error during install / modify config of the gallery2 module in xaraya? |
|