New Module: GWT Organise
Glooper
Joined: 2005-09-21
Posts: 225 |
Posted: Fri, 2009-09-25 04:16 |
Download from Gallery Modules. Shipped up all I did yesterday into one easy to install gallery module. It still doesn't run with any theme or anything but at least now it's easier to install and easy to access with the "GWT Organise" menu option. All you need to do to install is unzip this zip file into your module directory. Again only works on Firefox and Chrome (kind of works on IE but not well).. and requires the google gears add on. Right click to see context menus for items and to upload photos, add albums, edit albums etc. Drag and drop photos and albums around to reorganise and if you are in manual mode you can drag and drop to rearrange an album. Cheers Edit: updated to be embeded (cheers rWatcher for your help on that) and added double clicking to view image, and rotating of images. Edit: I've included the original beta 3 version and the new version for the pre RC1 release. This version as well as fixes for the latest code base also include the following: Edit: New Version for RC1 (when it's out) Edit: repackaged for RC1. Tested it and it works ok on the RC1 release. Edit: taken out reliance on google gears. Upload is disabled when no gears is found. |
|
Posts: 722
Cool, that definitely does make it easier to use
If you want I can write up some quick theme-integration code for you.
Posts: 225
Cool.. give it a go ..
Ben
Benjamin Albert Smith - Photography
Posts: 27300
Glooper,
Spectacular job. Keep up the great work.
I don't know much about gears but is seems that it helps out a LOT. A bit slow in some operations but a better UI in other respects.
GWT = ???
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 722
I'm assuming it means Google Web Toolkit.
Edit:
I've attached a modified version with some basic theme integration. I think the CSS might need to be tweaked a bit, but I can't seem to figure out what parts. Otherwise it should be good.
Posts: 225
@rWatcher
I had to remove the $item from the url in the admin_menu module method in gwtorganise_event to get it working. but yeah the css is all over the place a bit. It was what I was worried about a bit. The google GWT embed a lot of css and they have standard stuff in a directory under gwt/standard. but each time I compile the project it is overwritten. I kinda thought that it wasn't going to be compatible with the yahoo clean slate stuff, and some of the other css in gallery... just had a thought though... might be able to embed it in an iframe.. I'll have a go now
@floridave
gwt = Google Web Toolkit. It lets you write complex web applications using java.. which it will then compile into Javascript/css for you. Google gears is actually only used for the upload (instead of the flash plugin that gallery3 uses). I could have stuck with the gallery3's flash plugin but gears has a better gwt api and some of the other ideas I have for this module will make use of google gears... namely the drag and drop of image files from your desktop and the creation of thumbnails before uploading begins, just waiting for an update of google gears gwt api to add that functionality.
BTW... a potential solution for the IE6 7 8 integration problem that I'm sure all gallery3 developers, module developers and theme developers have had...
http://code.google.com/chrome/chromeframe/
Ben
Benjamin Albert Smith - Photography
Posts: 225
Ok..
got it working well embeded using an inner frame. Here's a new version of it. It runs in the admin theme
Also added double click on images to view the resized version and rotating of images.
Ben
Benjamin Albert Smith - Photography
Posts: 27300
Glooper,
I have created a skeletal codex page:
http://codex.gallery2.org/Gallery3:Modules:gwtorganize
Feel free to add more flesh or correct any mistakes I have made.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 225
Cheers Dave,
I fleshed it out a little adding some more functionality and a little bit about how to use it.
I'm not sure about how to add this to the contribs github folder though? As the source is Java code so needs compiling and so wont be unzippable straight into your module directory from a fresh download form github like all the other modules there?
Ben
Benjamin Albert Smith - Photography
Posts: 27300
I am no git expert. All I can do is point you to some docs:
http://codex.gallery2.org/Gallery:Using_Git
Perhaps rWatcher can help you out in this regard, he has created a bunch of useful modules as well.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 225
I'm fine with using git.. I've got two other previous modules in there that I've done... the problem is that this module isn't built in the same way as all the others in there, it's more of a how do I organise it problem ...
Ben
Benjamin Albert Smith - Photography
Posts: 358
@Glooper: i would just set up a build.sh in the project that build the js
http://www.timalmdal.com
Posts: 225
A quick update again (sorry!)... fixed a small security problem
Benjamin Albert Smith - Photography
Posts: 225
Added to github. In the end I just included the eclipse project. I think there are too many external variables to create a build script. Besides I'm on windows here so it's a pain in the arse to create ;)... I did consider writing an ant script... but to be honest I think someone building this project is just as likely/ more likely to have eclipse installed than ant anyway! I sent a pull request so Let me know if it's OK or not.
Ben
Benjamin Albert Smith - Photography
Posts: 722
Looks good!
One minor issue I found while playing around with the module -- If you double click on the thumbnail for a movie (which doesn't have any kind of resized version), the module gets stuck with that loading.gif file and has no way to cancel out of it (other then reloading the whole page). It might be a good idea to check and make sure the resized file exists before trying to load it.
Posts: 225
Fixed on this latest version... Double clicking is now disabled on anything other than photos and albums. Also if a resized version isn't available for some reason then a rather ugly error dialog box appears and the loading stuff disappears.
Also fixed a scroll bar that was sometimes appearing when previewing and image.
Ben
Benjamin Albert Smith - Photography
Posts: 32
Does this work in IE without having to installing stuff (Google..whatever)??
Posts: 225
It kinda works on IE..it just doesn't look very good.
And I'm afraid it forces you to download google gears to allow for upload and future functionality (except on chrome which has it pre-installed)
This module is meant for administrators rather than viewers of you site, which is why I concentrated on getting it good on chrome and firefox.. the assumption is that all administrators will be happy to use Chrome or Firefox
Ben
Benjamin Albert Smith - Photography
Posts: 32
You should never assume. I use IE and don't want to be bothered with google, chrome, gears, firefox, safari, etc, etc..
Don't understand why you would force someone to install google gears or anything else for that matter. I prefer modules that don't need any 3rd party junk.
Posts: 27300
paulmcnelis,
It is up to the developer to develop what he/she wants and can assume anything she/he wants.
I suggest that you don't use a module that does not meet your expectations. You should then develop one for yourself. Perhaps you will get some satisfaction in sharing your work with others. But I suspect you will have some excuse that you can't do this or can't find somebody that can, due to your attitude.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 358
@paulmcnelis: I was going to flame you for your last comment and the underlying attitude it exhibits, but I can't be bothered wasting my time.
@glooper: haven't had a chance to look at it, but i for one appreciate your effort +++.
http://www.timalmdal.com
Posts: 225
I'm not forcing anyone to do anything.. If you don't want to use this module then don't.. I mainly wrote this module for me not for you ... I just thought it would be nice to share it.
As an alternative to this module you can use the Organise, Simple Uploader, and other core functions that are installed as part of g3 and work well with IE and don't require google gears.
Ben
Benjamin Albert Smith - Photography
Posts: 32
This has absolutely nothing to do with how nice it is of Glooper to share this work. Yeah. He's an evil human being for being generous. And flame me? What is that talmdal, a veiled threat? Are we in high school?
I don't care if Jesus Christ himself came down on a cloud and shared this module. I'd tell him the same exact thing: why are you sharing a module that doesn't work on IE when IE is the dominant browser (last time I checked)? Not only that, but why are you making assumptions? Don't you know it's wrong to assume anything about anything or anyone? And on what basis are you making the assumption? Do you have access to G3 logistics that show the majority of admins use google chrome and firefox?
And floridave: yes, i know the developer can do whatever he or she wants. Obviously. Of course I'm not going to use a module that doesn't do what I want. Does that mean I can't say anything about it? Of course not. I don't like the ipod, but apple can do whatever it wants and force people to use itunes. I don't like that fact, so I won't buy an ipod. Does that mean I can't voice my opinion about it? Of course not. Same scenario here.
I'm not going to apologize for not mincing my words.
I'm a common sense guy and I'm all about common sense approach and results. You never manage to the exception. And the exception here is google chrome and firefox.
Posts: 27300
Then start a new thread so that this thread keeps on topic.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 225
Paul,
Firstly I apologize for making assumptions. The assumption was based upon 15 years as a professional in the industry... You are correct that IE is the dominant browser, however this is due to two reasons; the enterprise market, where enterprises are tied into microsoft products, and thus force their staff to use IE as standard, this is why there are still a lot of IE6's around. The second reason is that a lot people will only use the browser that is installed on their computer when it is bought, they would never even think to change to another browser. My assumption is that site administrators will not fall under those two categories, so if you take those figures out of the current market share (say from here... http://www.w3schools.com/browsers/browsers_stats.asp ) then my assumption (be it wrong or not) is that the majority of site administrators are using the other browsers, though probably mainly Firefox.
That aside, As I've said before, It does work in IE. it just doesn't look as good, the thumbnails are stretched slightly and the highlighted item on the tree is a slightly different colour... it's only minor issues and certainly doesn't affect the functionality of the module ... It would take more time for me to get it looking good for it... and I'm not willing to spend that time.. All my paying clients that will be using this software are using firefox, chrome and safari on mac, so my emphasis was on getting it working on that, and that only. However, this is open source software so anyone can pick it up (including you) and fix it.. the code is here..
http://github.com/Glooper/gallery3-contrib/tree/master/modules/gwtorganise/
so please go ahead and create a new module based on it to sort out the issues with IE. I'm willing to give any help to get you started.
With regards to google gears.. There is no way in IE and firefox to allow multiple files to be uploaded at once without installing a third party module. Gallery3 uses Adobe Flash to solve this. So I had a choice, try and use adobe flash or use google gears.. the reason I choose gears is that it also allows drag and drop from the desktop, which is something I plan to add in the future. Also Gears is a requirement for Google Wave which when it comes out will be something I'll be using with my clients as a way of communicating and planning their websites. So again it made sense for me to use google gears. Also chrome comes with gears pre-installed. Again please feel free to take the code and re-write the upload so it uses the flash upload. There is a GWT module available http://code.google.com/p/swfupload-gwt/ .. which can be used to change this module to use flash upload instead.
Ben
Benjamin Albert Smith - Photography
Posts: 7
specatular module! Great!
Posts: 14
I'm getting an error when trying to use.
Unexpected Error java.lang.Throwable: java.lang.IllegalArgumentException: empty argument - http://www.test.com/gallery3/index.php/json_album/is_admin/
Any ideas?
Posts: 225
What version of gallery are you testing against?. This was released for beta3 so might not work on the current experimental version.
If you are using beta 3 then I'm not sure what the problem is! is there any more information underneath the error message?
Ben
Benjamin Albert Smith - Photography
Posts: 14
I have upgraded to the latest experimental version, to try to resolve another issue!
Are you looking to make it compatible or waiting for the next public release?
Posts: 14
Ok, managed to get it working with the latest experimental version.
edit controllers/json_album.php
line 47
if (user::active()->admin) {
to
if (identity::active_user()->admin) {
Posts: 14
Ben, Could this module be edited so it can resize the image when uploading to the gallery?
Posts: 225
It was something I was thinking of doing... and something that is possible with google gears.
So maybe for the next version..
Ben
Benjamin Albert Smith - Photography
Posts: 3
You might roll that controllers/json_album.php fix from above into the download version. The bug is a show stopper, but the fix worked perfectly. I really like your organizing solution -- much better than the buggy built-in organize feature. Thanks!
Posts: 225
Any one got any ideas on how the resize should work. I've got it working OK but was wondering how it should happen. I don't really want a pop up to occur to do it each time you upload. Was thinking it could be a setting such that you can set it so that all uploads are resized to a certain size (or not). But would this be better done on a per album setting or global or both?
Ben
Benjamin Albert Smith - Photography
Posts: 129
Did anyone get this working on the latest git-code? Sounds really promising, but doesn't work for me.
Thanks,
David
Posts: 225
edbeeny has a fix mentioned above as of the Gallery 3 code in November. I'm not sure if there's been any changes to the main gallery code since then that would affect this module?
I'm currently working on some new features but I'm still based on Beta 3. I might upgrade soon, but would rather wait for the next official release.
Ben
Benjamin Albert Smith - Photography
Posts: 129
Hi,
yes saw that mentioned above.
@edbeeny, would you mind having a look on the latest git version?
anyhow, a great module!
thanks,
david
Posts: 3
Hi,
I trying to use the GWT organize module (from Git Hub) against the current experimental version of gallery3 But, there is always a 'but', I always get the following :
I ran the SQL request in a standalone SQL prompt and ... I got the same issue.
Any thought about this ?
Regards,
G'
PS :
I did the edbeeny fix.
My environment :
* Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
* Version du client MySQL: 5.1.37
* Extension PHP: mysqli
Posts: 358
@GiiGii: the problem is the OFFSET 0. The offset attribute can't be specified by by itself. it always needs the limit parameter. This is caused by the gwtorganize controller specifying a null value for the limit and a zero value for the offset parameter.
The other issue you could have problems with is we don't currently support gallery3 on a windows server. people have got it to work, but just a heads up.
http://www.timalmdal.com
Posts: 358
Just pushed a change to gallery3-contrib repository to address this issue.
http://www.timalmdal.com
Posts: 3
Ok thank for this quick answer & the change . I'm going to move my web test server on a linux dist.
Anyway, thank you.
G'
Posts: 10
I'm running into an issue. With a stock install (based on git clone from today I get a permission denied error in the iframe. From looking at the page source, the iframe's src is set to:
src="http://www.mysite.com/gallery3/modules/gwtorganise/war/index.php?url=http://www.mysite.com/gallery3/"
When I take the url parameter off, I no longer get the permission denied error. Also if I replace the forward slashes with %2F I no longer get the error. Obviously something about my web server doesn't like the encoding of it as such.
So I modified views/gwtorganise_view.html.php adding urlencode:
Posts: 20
@Talmdal -- I was experiencing the same problem as GiiGii. Your fix worked (resolved the offset error). Now I'm seeing the following:
Database_Exception [ Database Error ]:
#1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'L 'b' AND `parent_id` = 1 ORDER BY `weight` ASC, `id` ASC' at line 3 [ SELECT `items`.* FROM `items` WHERE `a` L 'b' AND `parent_id` = 1 ORDER BY `weight` ASC, `id` ASC ]
Any thoughts?
By the way, Glooper, I love this module. Excellent work. And, since you asked - Having an option to re-size for uploads is a great idea. I can picture a situation where it would make sense to do it on a 'per album' basis, but having a global setting makes sense, too. So, why not have a global setting that can be overriden at the album level? (i.e. a default that can be changed for an alubum upload)?
Posts: 358
@lancemorton: do you have a bit more of a stack trace? <gallery root>/var/logs
http://www.timalmdal.com
Posts: 20
@Talmdal -- I have attached the log from today; I believe this is what you're asking about. Thanks for having a look at it.
Posts: 358
@lancemorton: just pushed a fix... i hope. I don't use the module, so I have no way to test. We (the Gallery team) try to clean up things as we change the API, but don't take ownership of the maintenance of modules in the -contrib repository.
http://www.timalmdal.com
Posts: 225
Talmdal,
Thanks for doing that... ..
I will be maintaining it better when g3 is released.. I just can't afford the time to run two versions at the moment.. so I really appreciate your help here.
Ben
Benjamin Albert Smith - Photography
Posts: 358
oops, should be in the master gallery3-contrib now, inadvertently committed to my branch
http://www.timalmdal.com
Posts: 20
@talmdal ~ I updated the module with your changes. And here's what I see now:
Unexpected Error java.lang.Throwable: java.lang.IllegalArgumentException: empty argument - http://mortonplace.net/gallery3/index.php/json_album/is_admin/
There's nothing being written to the var/log regarding this (there's a file for today, but it simply reads, "<?php defined('SYSPATH') or die('No direct script access.'); ?>".
Happy friday!
-Lance
Posts: 358
@lancemorton: that's something we will have to leave for glooper or someone else that has GWT development environment set up to fix.
http://www.timalmdal.com
Posts: 20
@talmdal - thanks for your help along the way. For what it's worth, I made the changes outlined by edbeeny to address the empty argument error thown in 'is_admin' function.
edit controllers/json_album.php
line 47
if (user::active()->admin) {
to
if (identity::active_user()->admin) {
This cleared up that error. Now I have a new SQL error (log attached). I'm not asking for any work to be done on this right now; however, I thought this might be helpful information to someone along the road to resolving the problems with this module (still one of my favorites).
cheers!