Windows XP Uploader with G2
rtdean
Joined: 2004-12-03
Posts: 2 |
![]() |
Hey, I love the Windows XP uploader with the older version of Gallery. I notice it is not included at this time with G2. Will this feature be available for G2? Or is it availale now? |
|
mindless
![]()
Joined: 2004-01-04
Posts: 8601 |
![]() |
we'll probably get to it eventually... anyone want to write it? |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
mindless, I took a quick look at the code in publish_xp.php and it doesn't look overly complicated to covert it to G2. Would the intention be to have this use the same flow as in G1 only with it updated to use the new methods required for G2 or are there other changes that need / should be made? |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
I think that we should maintain the same feature set as we have with G1. We should create a new module with an ItemAddPlugin that provides you with the registry file for XP, then provide it with a URL directly to a controller inside the new module which provides all the functionality that it needs. The remote module is a good example of how to do all of this. Look at modules/remote/GalleryRemote.inc to see how to do the command processing. We're around to provide guidance... |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Excellent. Then I volunteer to at least make an attempt at an implementation. Should the processing be the same such that the Publish function in XP iterates through the selected photos sending one at a time? Or more generally, since the module will be providing it's own controller, keeping the same protocol as used in Gallery 1 should be acceptable? |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
I believe I've answered my own questions. The way the publish mechanism in XP works forces the way the uploads are processed (after the XML is modified). And as for keeping the same protocol, to take advantage of some services offered by G2, I'm using the new form model which by definition means a different protocol. |
|
rtdean
Joined: 2004-12-03
Posts: 2 |
![]() |
Thanks for working on this. If you need a beta tester, let me know. I'm not much of a programmer, but I can install and let you know how it works on my site. |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
rtdean, Thanks for offering to beta test it. I'll definitely take advantage of your offer! I should have something to try around the end of the week if not sooner. I'm changing the style and flow slightly to make it feel more integrated with the Publishing Wizard so when I send it along, I'd definitely appreciate feedback on how the user experience is in addition to whether it works or not. |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
I've finished an initial implementation of the PublishXP module that allows users to publish using XP's publish wizard. Since this is actually my first attempt at PHP, I'm sure I haven't used it correctly. Though as far as I can tell, it seems to be working well with G2 -- it's a complete rewrite from what was used in G1. rtdean, would you mind giving this a try on your system and let me know how it works for you and any suggestions you may have? bharat, could you please review my code and answer some questions I have? Please see below. The module as it is currently implemented can be downloaded from http://www.pospues.com/addons/ So my questions are: 1. Since each page that is served to XP needs to follow a given format, it would have been helpful for me to use the template processing support that G2 uses. Is this something worth pursuing, and if so, where should I look to figure out how to leverage it? Please see my base WizardPage class I used to abstract out the different steps in the flow. 2. What's the right way for me to make this localizable? I know for sure that how I currently have it isn't right since I have hardcoded strings all over the place. But since I'm not using templates, I can't use {g->text text="..."}. Please see any of the classes/*Page files for an example of what I mean. 3. I decided against using the style sheets from the selected Gallery theme since I felt having it appear more like XP would give the user a more consistent experience. All of it seems to be working well, but I have hard-coded the background color of the Publishing wizard window to have the pages match the background. Does someone know of a way in IE to access the current system background color for dialogs? As users can change Windows default colors, this would make my hardcoded value show up as an off-color background. 4. I've updated the generated registry file to use the domain name in the publishing wizard. This makes it easy if a user needs to publish to multiple sites -- though perhaps I should use the name of the top-level album. What seems to make the most sense? Do most people rename their top-level album? Or is using the domain name more consistent for users? 5. My most basic question is... How does my coding style look in PHP? I've been working in compiled languages so long, it's taking a bit to switch over and I'm not sure if my OO design makes sense in how PHP is set up. I broke each page of the wizard into a separate file to make it more maintainable but perhaps there is a better way of accomplishing the same thing in PHP? 6. For PHP, I had tested on my local system code like $gallery->getUrlGenerator()->getCurrentDomain() and it all worked well. When I uploaded it to my Linux server I host a Gallery on, it failed. I had to update it to split the command into two lines. (The Linux server is running 4.3.x while my local development box is running 5.0.x of PHP). Is this a structure we should generally be avoiding? 7. My final question is around locks. In a number of places in G2 code, I've seen locks being established and then during processing, if an error occurs, return is called before explicitly releasing the locks. Does this mean that G2 automatically releases locks upon error conditions? Or should these failures be releasing locks before returning? 8. Do you have a good example of how we should be using phpunit? I'm not familiar with phpunit (though I am aware of extreme programming principles). 9. For questions like these going forward, should I be using the gallery-devel mailing list or are the forums the right place to ask questions for the development of G2 modules? Thanks, |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
This is a great start! I have a lot of comments, but I think that you're mostly I did this review over two days so it might be a little disjointed, sorry! I General issues:
Since you have some HTML that you render on every page, you can follow Style issues:
PublishXP.inc:
DownloadReg.inc:
To answer your specific questions:
[/] [/] [/] [/] [/] [/] |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Thanks for the detailed comments. I definitely appreciate the course correction before I went too far down this path. I believe I understand what you are getting at though I'll have to go through implementing the comments to know for sure. Quote:
You can render all of your pages inside the gallery global template, which What I was worried about is screen realestate. The wizard window in XP is non-resizable. After looking into this, I realized that the navigation on the left-side of Gallery is just provided by the template and as such, I can easily define templates that use the standard styles but don't require excessive realestate. Thanks for the links to coding guidelines and the development environment. As a follow-up, do you have a recommended IDE to use for development of PHP and Gallery? |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Yea .. I think that once we get something going we can take a look at it and figure out whether it's going to be too messy to do it with the global template. We may want to create a new "slim" template for things like this (but we can easily do that later once your code is templatized). I use Emacs to do my PHP development. If you use php-mode.el, it does most of the work for you. Apply our php style on top of that and it'll conform to the G2 style (mostly). Signe uses PhpED and likes it, I think. I'll let him weigh in on that. |
|
signe
![]()
Joined: 2003-07-27
Posts: 2322 |
![]() |
I find that I do most of my work in vim... it's configurable, and it has good defaults for php. phpEd is a wonderful IDE, but I've found that it doesn't like the G2 coding standards unless I pay a lot of extra attention. The auto-indenting and select-shift/ctrl-shift stuff (normal Win32 IDE indent/unindent hotkeys) aren't all that well done. The one thing that phpEd has that I haven't really seen in any other IDEs is server-side runtime debugging and code profiling. The ability to single-step code while it's executing is unbelievably useful to me in G1 and G2 (and any PHP code, really). The profiling has come in handy several times, and is a nice tool, but not useful on a day-to-day basis. The main problem with phpEd is the cost. ~$300 for a single license... extra licenses are cheap, but it's the first one that kills you. |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
In the screenshot below, I am now taking advantage of the templates (per recommendation). Apart from the screen being compact, I'm running into an issue with the layout. Could someone please point me at better CSS options to use in order that the components stretch to the right side of the screen? Here's what I'm using right now (the CSS tags lifted from another page under core): <div id="gsAdminContents"> <div class="gbTopFlag"> <div class="gbTitle"> <h2 class="giTitle"> {g->text text="Choose the album for new items"} </h2> </div> </div> <div class="gbAdmin"> <div class="gbDescription"> {g->text text="...snip..."} <a href="javascript:createNewAlbum();">{g->text text="create a new album"}</a> {g->text text="...snip..."} </div> <div class="gbDataEntry"> <select ...... [/code] |
|
RwD
![]()
Joined: 2005-01-09
Posts: 383 |
![]() |
Would like to help you (testing) But actually have not a good idea of how to install the thing. Usually I find the weird errors, not sure if you are gonna like me for testing :roll: |
|
kylemcginn
Joined: 2005-01-11
Posts: 1 |
![]() |
Also would like to help out testing, but also having problems installing! Any chance you could put a quick 'howto' up? I've got the module installed and activated correctly but unable to to get the registry download working. Thanks! |
|
RwD
![]()
Joined: 2005-01-09
Posts: 383 |
![]() |
How did you install and activate the module? Perhaps in return I know how to solve your problem ;) |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
The files that I published previously would be extracted into the modules area under your gallery2 installation. That said, for PublishXP, I'm working on a rewrite given Bharat's comments on my first attempt. Given the magnitude of the changes, I'd ask that you wait to test it -- and then I'd definitely appreciate your help testing it out and giving feedback. Thanks! |
|
RwD
![]()
Joined: 2005-01-09
Posts: 383 |
![]() |
Personal preference: Is it possible to be able to manually set image titles and descriptions instead of just the descriptions? |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Potentially, though I feel that naming items and descriptions is part of the core proficiency of Gallery. Or optionally you can assign useful filenames in the operating system prior to upload. If we do it as part of the upload process and for some reason, you have to abort, you end up loosing all of your work, whereas in Gallery or beforehand in the OS you have the same capability but it is persisted. The titles can be set to the filenames with or without the extensions but are always set. Is what you are looking for an efficient way to name all items in an album? |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Quote:
Also would like to help out testing, but also having problems installing! Any chance you could put a quick 'howto' up? For testing this, when I have a new version available with the updated UI and implementation model, I'll also publish a HOWTO on how to get going with it. Thanks. |
|
RwD
![]()
Joined: 2005-01-09
Posts: 383 |
![]() |
yes, I found that all options inside gallery2 basically give you no options. You can choose sizes, orientations and type in a description. I would like to be able to quickly set the title for 80 items and add a description if I want one for pictures comming from a digi-cam (so the filenames are always numeric) So having inputfields available without having to open a seperate page for each image or anything faster then that would be great! Any ideas? |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Please see this topic: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=24557 I have similar concerns and Bharat mentioned that there is a new update that allows multiple items to be renamed. |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Try using |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Thanks, that did it. |
|
c4actbe
![]()
Joined: 2004-09-01
Posts: 83 |
![]() |
any updates? it doesn't work with my week old g2 build. Line 301: if ($ret->isError()) { |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
c4actbe, you may understand that we can't support old g2 builds during alpha development. i'd recommend upgrading to beta 1 tonight when beta is out. besides, your error was much too general... |
|
c4actbe
![]()
Joined: 2004-09-01
Posts: 83 |
![]() |
i am not seeking support. I do not expect anyone to drop whatever they were doing and start helping me with my problems. |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Sorry, I've been caught up in some busy times at my day job. If the work for the new G2 Remote Protocol doesn't invalidate this work, then I can publish a new version that works with the updated APIs. I'll publish a message when it's tweaked. |
|
c4actbe
![]()
Joined: 2004-09-01
Posts: 83 |
![]() |
the funny part is that after giving error, this module got activated after 2nd try. |
|
quentinjs
Joined: 2004-11-25
Posts: 32 |
![]() |
any more news on this ? |
|
sethcohn
Joined: 2005-03-21
Posts: 3 |
![]() |
quentinjs wrote:
any more news on this ? Bump. Another user looking for this to allow my wife the easiest way to upload. |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
We haven't forgotten. But we haven't acquired any new resources to work on this, either :-/ |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
I've finally put together an updated version of the publishxp module that I originally put together for an early version of G2. This includes most of the recommendations that Bharat made, however I have other tweaks left to make including phpunit integration. I've tested with this Gallery 2's latest version in CVS. One note, you may have to re-register your gallery with XP using the Add Items -> Windows XP option and downloading the appropriate registry file. Download the updated module from: Please let me know any comments or problems you have using this module. Good luck. Tim |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Instructions: Forgot to mention, to activate, extract into your gallery2/modules directory. Go to Site Admin, and select modules. From there, look under Import and click "install" for Publish XP. When the page comes back, you'll now need to select "activate". There is nothing to configure for this module. Bharat or others: At line 85 of NewAlbum.inc (ignore the coding conventions, will be fixed later), I set into $form['album'] the ID of the album that has been created. The idea being, that when the user returns to SelectAlbum, the newly created album is already selected. For some reason, when it returns to SelectAlbum, it appears the change has not been picked up. I've tried to use both redirect and delegate to get the behavior I want, but in both cases, I am unable to get the value out. One thought I had was whether $form was being passed in by value or reference, so I tried changing it to & $form without any change (again, still a novice at PHP). Any suggestions on how I can get the value change in $form['album'] to be available when rendering the SelectAlbum view? |
|
g0d
Joined: 2005-03-12
Posts: 22 |
![]() |
i get the following error: Parse error: parse error, unexpected T_OBJECT_OPERATOR in /modules/publishxp/DownloadReg.inc on line 48 |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Quote:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /modules/publishxp/DownloadReg.inc on line 48 Looks like I'm still taking advantage of some PHP5 language syntaxes. I'll remove them and re-publish. To confirm, what version of PHP are you using? |
|
sethcohn
Joined: 2005-03-21
Posts: 3 |
![]() |
pospues wrote:
Same error here, less than PHP5 (PHP 4.something) |
|
sethcohn
Joined: 2005-03-21
Posts: 3 |
![]() |
sethcohn wrote:
It's the $gallery->getUrlGenerator()->generateUrl() lines that it chokes on (also in UploadItems) replace all of those with and it should work (does for me!) |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Re-published with the updates -- actually had the exact same code you mentioned down to the variable name ;-) Thanks for confirming that this fixed it. Hopefully this now keeps working through the G2 final release. Now it's working for others, I'll go through and clean up the code per Gallery style conventions. Cheers |
|
g0d
Joined: 2005-03-12
Posts: 22 |
![]() |
Thanks it works now ... |
|
internetgardener
Joined: 2004-09-10
Posts: 5 |
![]() |
Just installed G2 (Dark - Beta1) - works and looks great!. Download your most recent version of the XP Publishing tool. When I go to gallery modules/import I get the following error showing up: Publish XP 0.9.1 Implementation for direct publishing from XP Not sure what it means by "Core API Reqired: 5.0 (availablle: 4.0)" Thoughts? Cheers, |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
Modify the module.inc file in the publishxp/ directory. Change: $this->setRequiredCoreApi(array(5, 0)); To the following: $this->setRequiredCoreApi(array(4, 0)); I've been testing this module against the latest version in CVS. Please confirm that this fixes your issue. |
|
rstocks
Joined: 2002-12-18
Posts: 26 |
![]() |
Installed this module this morning and gave it a quick run. Originally had the same issue as internetgardener, but grabbed the latest snap and updated the beta rather than hack the version required in the module. Pospues, great work! Download of the registry file was flawless, and the upload worked perfectly. Very nice piece of integration work. On a side note to the devs: great work also on the updater! I went from the Dark Fibre beta release to the current CVS snap, and the update process was faultless. Very slick work from all involved. Cheers, Rich |
|
internetgardener
Joined: 2004-09-10
Posts: 5 |
![]() |
That worked GREAT! Thanks for the fix. Now I am just trying to figure out what I need to do on the registry side of things. Gallery 1 had a nice little publish_xp.php that when downloaded gave the proper registry entry. Thoughts? Curt |
|
arehm
Joined: 2002-11-14
Posts: 16 |
![]() |
Everything works fine for me untill i go to view the albums i have uploaded. There is nothing there. www.therehmsonline.net is the site. Anyone else having this problem? |
|
pospues
![]()
Joined: 2004-12-28
Posts: 31 |
![]() |
internetgardener If you activate the module, you just have to go to Add Items for any of your albums and select Windows XP using the tab at the top. From that page you can download the registry file. |
|
internetgardener
Joined: 2004-09-10
Posts: 5 |
![]() |
Thanks Pospues - again, worked great. i am now running into same issues as arehm. Images don't show up once uploaded. Still trying to diagnose the problem. IG. |
|
arehm
Joined: 2002-11-14
Posts: 16 |
![]() |
pospues, your account is active....still have the same problem. As soon as i get xp publisher i'm going to get my sister with her nikkon D70 to test it out... see how my site handles huge pix |
|
lindehoff
Joined: 2005-04-03
Posts: 20 |
![]() |
I get a "Internet Explorer Script Error" when I try to uppload, it come's up when the upload is about to start. |
|
arehm
Joined: 2002-11-14
Posts: 16 |
![]() |
i uploaded a picture 100_5710.JPG here's all i see when i search for 5710 on my server var/www/html/g2data/cache/entity/5/7/5710.inc the picture does not exist on my site.... |
|