Forum Index > FlashYourWeb OS Support > Gallery New Topic Post Reply
 G2 Restfull Gallery as default
 |  Printable Version
kxr
 March 24 2013 11:59 AM (Read 1473 times)  
Forum Newbie
Newbie

Status: offline

Registered: 03/24/13
Posts: 6

Thanks for all the work. I came across g2 restfull sample you have test.suprsidr.com/m, it works great, desktop and mobile devices alike. I was thinking of getting a shutterfly account and I came across your g2-restful implementation and this has changed my mind.

Could you give me any pointers or samples on using the restful implementation as the default for g2? I would just like to use this as the default for all albums in my site along with the authentication in g2.

Any help is greatly appreciated.

thanks
--karthik


 
Profile Email
Quote
suprsidr
 March 24 2013 13:07 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

The G2 RESTful script is for displaying G2 items only.
You would still use the regular G2 interface for add/edit/delete...

And as you can embed the RESTful script in any webpage you can make that your default view.

-s


There will always be...
 
Profile Email Website
Quote
kxr
 March 30 2013 10:20 AM  
Forum Newbie
Newbie

Status: offline

Registered: 03/24/13
Posts: 6

Yes I want to view it as the default mode to view the albums, using g2 interface for all other functionality is totally fine.

When you say embed the Restful script in an webpage I am assuming you mean embed the script in say the album template? I will try something like this.

thanks
--karthik


 
Profile Email
Quote
suprsidr
 March 30 2013 13:24 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

Quote by: kxrWhen you say embed the Restful script in an webpage I am assuming you mean embed the script in say the album template?

No.

You use my example to embed G2 RESTful gallery into a page on your site that you want to be your default gallery view.
You can structure the page to look like your website or what ever you want.

-s


There will always be...
 
Profile Email Website
Quote
kxr
 March 30 2013 19:30 PM  
Forum Newbie
Newbie

Status: offline

Registered: 03/24/13
Posts: 6

The thumbnails dont show up. Using the url from the src attribute of the img tag in directly in browser causes an error in gallery. The "&" are encoded as "&", if I change them to just "&" the urls work.

I looked at rest.php and the gallery UrlGenerator::generateUrl() is used to generate the thumbnail url. I am runnning gallery 2.6. Is there a way to make the urls to generate the url without escaping the "&"-s? or any config in gallery?

If you could help that would be great. Please let me know if I should post this to a gallery forum instead?

thanks
--karthik


 
Profile Email
Quote
suprsidr
 March 30 2013 19:42 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221


There will always be...
 
Profile Email Website
Quote
kxr
 March 31 2013 21:25 PM  
Forum Newbie
Newbie

Status: offline

Registered: 03/24/13
Posts: 6

Upgraded my gallery successfully, I used the minimal_page_structure sample, the items are listed but the thumbnails still dont show up.

Gallery version = 2.3.2 core 1.3.0.2
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.17 cgi-fcgi
Webserver = Apache
Database = mysql 5.5.30-log, lock.system=flock
Toolkits = LinkItemToolkit, Thumbnail, NetPBM, ArchiveUpload, Exif, Gd, ImageMagick


The urls of the thumbnails are still generated with the "&" encoded as "&".
I am using the url rewrite module, I tried disabling it just in case but no luck.

Any suggestions, do I have to clear any code cache or something like that?

thanks
--karthik


 
Profile Email
Quote
suprsidr
 April 01 2013 04:13 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

you'll have to send me a url to your test page.


There will always be...
 
Profile Email Website
Quote
kxr
 April 01 2013 15:54 PM  
Forum Newbie
Newbie

Status: offline

Registered: 03/24/13
Posts: 6

I was able to get the thumbnails to work by passing htmlentities as false to UrlGenerator this does not encode the "&" as "&"
- In you example site, the links are rendered as the virtual links
- On my gallery installation, I have the url rewrite module enabled and in regular g2 interface the links are all virtual "/v/...." but in the rest interface the links are not virtual, if I can figure that out then I can change htmlentities back to true


There seems to be permission issues that I have to figure out

1) Password protected albums
- albums that are password protected, currently are rendered as a link, when clicked does not go to the right page, remains in the parent's page but displays the description of the album. This is still ok since it needs a password. I will have to figure out to make this go to the login page
- From the regular g2 interface if I enter the password for the album and then open the rest interface, the thumbs of all children show up fine, but still the image does not
- Everything works fine if I login as a user that has full permissions and then open the rest interface

2) Open non-protected albums
- I am able to see the images in one but not the other. The only difference is one has watermarked images and the other does not, I dont know if this is related

- Also the rest interface is pulling the original image and not the watermarked ones - maybe this is bcos I am able to get it to work only with a user with full permissions?

What permissions is required by the Restful implementation for the images to be displayed?

thanks
--karthik


 
Profile Email
Quote
suprsidr
 April 01 2013 17:06 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

You are using this script for far more advanced operations than I've ever tested or care to test with.
I developed the script with a wide open gallery. No password protected albums, no hidden albums...

This script was designed to display your gallery in another page -> even cross domain, but only anonymously, hence the need to use the G2 interface for advanced operations.



What permissions is required by the Restful implementation for the images to be displayed?

You can try to init gallery with the current user.
http://galleryproject.org/apidoc/GalleryCore/Classes/GalleryEmbed.html#methodinit

If I had a client requesting these features, I certainly would investigate further. But this script and most others have netted me $0.00 - so desire lost.

-s


There will always be...
 
Profile Email Website
Quote
kxr
 April 01 2013 19:07 PM  
Forum Newbie
Newbie

Status: offline

Registered: 03/24/13
Posts: 6

I understand, thanks for everything you do. I will try playing around with the script.
thanks
--karthik


 
Profile Email
Quote
suprsidr
 April 01 2013 20:33 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

I appreciate the contribution. If there are any specific questions, feel free to ask

-s


There will always be...
 
Profile Email Website
Quote
Content generated in: 1.13 seconds
New Topic Post Reply



 All times are PDT. The time is now 12:40 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
HTML Allowed 
Censored Content