Dragonfly CMS (AKA: CPG Nuke) & G2

WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Thu, 2005-10-27 05:54

I had installed G2 and tried to incorporate it to DF CMS module. Installation went well but when I click on the link for the Gallery instead of sending me to mydomain\modules\gallery it redirect to mydomain\main.php instead. How can I fix this problem.

PLESE HELP!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-10-27 11:03

see docs/EMBEDDING for proper embedUri, embedPath and relativeG2Path values for GalleryEmbed::init

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Thu, 2005-10-27 17:27

I had read the file, but I am still confused. Where do I edit the integration code as indicated in the EMBEDING file? It does not tell my where or what file to go to so I can make changes.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-10-27 20:07

there are no changes required.

you must create your own file, a wrapper. your file should be called by your CMS (cpgnuke) and your file will load G2.

see the sample wrapper file from the sticky embedding and integrations topic, attached to the first post.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Thu, 2005-10-27 23:31

OK! With a lot of modification and many try to get it working. I got the G2 integrated in and able to view it through the CMS. But I have no admin function or login link at all. What did I missed? See attachment to see what I mean.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-10-27 23:36

when embedded with GalleryEmbed, we donöt show a login link.
it's meant that way.
you should forward the activeUserId of the cpg user to G2 in GalleryEmbed::init.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Fri, 2005-10-28 00:50

How and what is the command line?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-10-28 10:30

see docs/EMBEDDING and take a look at existing integrations for examples.

@command line
where did you read something about the command line?
google for command line for a comprehensive answer. command line = shell = tool to enter your commands on an operating system.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Fri, 2005-10-28 17:11
valiant wrote:
@command line
where did you read something about the command line?
google for command line for a comprehensive answer. command line = shell = tool to enter your commands on an operating system.

Opps! I did mean the command line as in shell tool, missed use of words. What I was trying to say was "what code" or something like that. I'll look over the EMBEDING again. May be I missed something after the last look.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-10-28 17:31

then the answer is again:
please take a look at existing integrations. or some other forum topics in the g2 interations forum.
i've answered this already a few times.
yeah, we need better docs. but learning from examples (other integrations) should be ok for now.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Mon, 2005-10-31 22:57

I know you had said that you had answer this already, but other integrations did not help me in getting user integration part done.

I had follow every instruction I can find in the othe post. But still the same outcome. NO User integration I dont even see the side bar at the left when calling the gallery from the CMS.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-10-31 23:03

look into

GalleryEmbed::init activeUserId argument if the cms user has already been mapped / created in g2
GalleryEmbed::addExternalIdMapEntry for existing users
GalleryEmbed::createUser for when users sign up on your website

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Mon, 2005-10-31 23:45

I think I have GalleryEmbed::init activeUserId correct. But I dont know if I do.

How do I add these other 2 line here.

GalleryEmbed::addExternalIdMapEntry for existing users
GalleryEmbed::createUser for when users sign up on your website

I dont have these in the embed file yet.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-11-01 00:09

as i said, wp, drupal, joomla, ... they're all doing it correctly. much code to learn from.
sorry, don't have time to explain it right now. but learning from other code is quite normal.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Tue, 2005-11-01 15:53

That what I had been doing to get where I am at. I seen those command somewhere. I'll go ahead and find it again and study somemore of that part of the code.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Tue, 2005-11-01 20:07

This was the error I had when I changed activeUserId to $userinfo['$username']

Quote:
Error (ERROR_MISSING_OBJECT) : Anonymous GalleryUser
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\helpers\GalleryEntityHelper_simple.class at line 138 (gallerystatus::error)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\GalleryCoreApi.class at line 2225 (galleryentityhelper_simple::loadentitybyexternalid)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\GalleryEmbed.class at line 184 (gallerycoreapi::loadentitybyexternalid)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\GalleryEmbed.class at line 94 (galleryembed::checkactiveuser)
• in C:\Inetpub\public_html\modules\Themes_Gallery\index.php at line 27 (galleryembed::init)
• in C:\Inetpub\public_html\index.php at line 91

And when I tried to use addExternalIdMapEntry.
$ret = GalleryEmbed::addExternalIdMapEntry($username);
or
$ret = GalleryEmbed::addExternalIdMapEntry($userinfo['$username]);

I get this error:

Quote:
Error (ERROR_STORAGE_FAILURE)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\GalleryStorage\DatabaseStorage.class at line 1238 (gallerystatus::error)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\GalleryStorage.class at line 294 (mysqldatabasestorage::addmapentry)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\interfaces\ExternalIdMap.inc at line 96 (gallerystorage::addmapentry)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\GalleryEmbed.class at line 784 (externalidmap::addmapentry)
• in C:\Inetpub\public_html\modules\Themes_Gallery\index.php at line 31 (galleryembed::addexternalidmapentry)
• in C:\Inetpub\public_html\index.php at line 91

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Tue, 2005-11-01 21:12

OK I had also added this
$ret = GalleryEmbed::createUser($userinfo['$username]); below $ret = GalleryEmbed::addExternalIdMapEntry($userinfo['$username]);

and now I am getting this error.

Quote:
Error (ERROR_BAD_PARAMETER)
• in C:\Inetpub\public_html\modules\Themes_Gallery\modules\core\classes\GalleryEmbed.class at line 290 (gallerystatus::error)
• in C:\Inetpub\public_html\modules\Themes_Gallery\index.php at line 32 (galleryembed::createuser)
• in C:\Inetpub\public_html\index.php at line 91

I am not sure what to use for the parameter. DAZE AND CONFUSED! And still no user integration. :(

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-11-02 02:25

$ret = GalleryEmbed::addExternalIdMapEntry($username);
that's incorrect.

see modules/core/classes/GalleryEmbed.class for the proper usage of this function

@param above the function name are the parameters it expects
@return is what it returns.

and i'd like to encourage you again to take a look at existing integrations. functions like this are used in every integration. by mimicking the usage, you get it right automatically.

also, do not call ::createUser AND ::addexternalIdMapEntry.
call either ::createUser OR ::addexternalmapentry.

why and when to use what?

call createUser for users that don't exist in g2 yet (all users but admin, anonymous). createUser automatically also call addexternalMapentry (take a look at the source code of createuser).
call it only once for each user. do not call it on each request.

call addexternalmapentry for admin and anonymous. just once and then never again.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Thu, 2005-11-03 17:53

OK! I have another problem. I first setup the test server and everything is fine uploaded images show up correctly. But when I setup on a live server the uploaded image will not show up.
See link below:
http://www.cbfauna.com/index.php?name=Projects_Gallery

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-03 18:17

maybe you need to use another embedPath relativeG2Path, ... there?
maybe it's a misconfigured webserver.
just browse to one of the img urls:

http://www.cbfauna.com/modules/Projects_Gallery/main.php?g2_view=core.DownloadItem&g2_itemId=91&g2_serialNumber=2

and you'll see the error.

 
WebSiteGuru
WebSiteGuru's picture

Joined: 2005-10-27
Posts: 19
Posted: Mon, 2005-11-07 23:55
valiant wrote:
maybe you need to use another embedPath relativeG2Path, ... there?
maybe it's a misconfigured webserver.
just browse to one of the img urls:

http://www.cbfauna.com/modules/Projects_Gallery/main.php?g2_view=core.DownloadItem&g2_itemId=91&g2_serialNumber=2

and you'll see the error.

Fixed that problem, it's the .htaccess file that was blocking the pics.

 
sasha2002

Joined: 2009-01-16
Posts: 3
Posted: Fri, 2009-01-16 12:22

Dear WebSiteGuru and valiant
Can you upload you module to other site, and explain how to integrate Gallery v2.x.x in to DragonflyCMS aka CPG Nuke?