docsys-devel Mailing List for DocSys Document Management System
Status: Beta
Brought to you by:
bryce
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2005 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bryce H. <br...@br...> - 2005-04-24 21:49:59
|
Document::Manager (DMS) 0.11 has been released and posted to CPAN, and will soon appear at this location: http://cpan.uwinnipeg.ca/dist/Document-Manager Changes since the last release have focused on a Document::Object module for use in tracking metadata and other aspects of a given document. As well, more internal data checking is performed to hopefully catch issues. This is a development release, and is still not really usable. I notice that the daemon crashes due to Broken Pipe errors quite a bit, and I've not tested the metadata store function very much. My guess is that there's a lot of bugs hidden away in it, but given increased interest lately and the fact that the last release was 6 months ago, I figured it was time! One of the main design challenges I've been wrestling over this year has been that PHP and Perl don't communicate as well through SOAP as I'd initially assumed. That was a pretty big let-down, since that was one of the main reasons I'd built this around SOAP. It looked like to recast it into something PHP could tolerate would require a complete rearchitecting of a lot of the Perl code, or alternately would require doing the website in Perl instead of PHP. However, with some help from discussions on the OCAL list, I think there's a fairly simple solution: Instead of having the PHP access the SOAP API directly, implement Perl scripts to perform the SOAP actions. Not an eligant solution, but a heck of a lot less work than other options. One benefit is that it'll decouple things in a nice fashion. Bryce |
From: Bryce H. <br...@os...> - 2005-01-08 01:28:04
|
A bugfix release of WebService::TicketAuth, version 1.05, is released to CPAN and should appear there shortly. This implements some further fixing to the inheritance behavior in the authentication system. http://cpan.uwinnipeg.ca/module/WebService::TicketAuth Should be up there later this evening. Bryce On Wed, 5 Jan 2005, Bryce Harrington wrote: > > I've just posted a new release of the WebService::TicketAuth module to > CPAN, version 1.04. Changes in this release: > > * Inheritance behavior between WS::TA and WS::TA::DBI fixed > * Documentation on using SSL for encrypting login passwords > * Improvements to examples > > Bryce > > |
From: Bryce H. <br...@os...> - 2005-01-05 21:22:13
|
I've just posted a new release of the WebService::TicketAuth module to CPAN, version 1.04. Changes in this release: * Inheritance behavior between WS::TA and WS::TA::DBI fixed * Documentation on using SSL for encrypting login passwords * Improvements to examples Bryce |
From: Bryce H. <br...@os...> - 2004-11-16 00:05:21
|
This can be obtained from CPAN (www.cpan.org). There may not be an rpm for it, so you may have to either create your own rpm from the tarball, or just install the tarball directly. (Instructions are included). Bryce On Tue, 12 Oct 2004, Thamara Wanigatunga wrote: > hi, > > for the past few days i'm trying to install docsys on > RH 9.0, i read the Makefile.PL and installed the > modules that were listed. But I cannot get the > Image::Magick 5.27, i could not find the module/rpm. > And versions higher to this, do not seem to work as > well. Pls help me. I'm new to perl/mysql. Could you > let me know what i should after installing all > pre-requist sw. > > Thanks > > > > _______________________________ > Do you Yahoo!? > Declare Yourself - Register online to vote today! > http://vote.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Docsys-devel mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docsys-devel > |
From: Thamara W. <tha...@ya...> - 2004-10-12 10:11:27
|
hi, for the past few days i'm trying to install docsys on RH 9.0, i read the Makefile.PL and installed the modules that were listed. But I cannot get the Image::Magick 5.27, i could not find the module/rpm. And versions higher to this, do not seem to work as well. Pls help me. I'm new to perl/mysql. Could you let me know what i should after installing all pre-requist sw. Thanks _______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com |
From: <ben...@id...> - 2004-05-25 09:45:51
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Bryce H. <br...@os...> - 2004-05-06 21:11:28
|
Pat Deegan has made some improvements to the Sort::Tree module, so I've put up a new release 1.09 with these changes. It's available on SourceForge now, and will be available on CPAN within a day or so. Bryce Pat writes: > Greetings. Liked your pictures of Eire--I've been itching to go. > > Anyhow, I've been playing with Sort::Tree and wanted to start by telling > you I appreciate the module. I needed a little additional > functionality, as well as support for non-numeric (e.g. alphabetical) > sorting, so I've made some mods and am sending you the patch. > > Other than the sort bugfix, I've added a traverse() function which is > used to call a callback for each tree element in a depth-first search. > The method can be used to modify tree elements and/or return a specific > tree item or information. I've include some examples in the pod. > > I'd be glad to release the mods to you under the same license as the > module itself, in exchange for leaving my contrib notice in the module > ;) > > Let me know what you think or if you'd like me to make any changes to > the traverse() interface. 1.09 2004/05/06 14:00:00 bryce - Added patch from Pat Deegan implementing alphabetical sorting, the traverse() function, etc. |
From: Bryce H. <br...@os...> - 2004-02-14 22:36:37
|
On Sat, 14 Feb 2004, Thomas Soares wrote: > I've been trying to install the Eidetic Document Management system > (Eidetic 2.002012 and docsys 0.023005) but have run into some problems, > which I was wondering if you could shed some light on. > > During the Eidetic installation I was able to install the database, and > both "make" and "make install" went okay. "make test" failed probably > due to database configuration (Unknown MySQL Server Host 'mysql')--is > there some database configuration (aside from eidetic.conf) that needs > to be done for make test? I set the DESTDIR for eidetic to > /usr/local/eidetic. Yes the Eidetic tests will fail until your database is set up, but for docsys installation purposes can be safely ignored. Go ahead and do a make install. You will want to set up your database config stuff in the file /etc/eidetic/docsys.conf > I went on to try to install the Document Management System, but it fails > because Eidetic is not installed. Aside from the instructions for the > Eidetic install, are there any other steps necessary to make it > recognized by the document management system? No, just the make install step should be enough. However, I haven't actually tested installing it to /usr/local/ instead of to the default locations, so there might be some additional tweaks needed to get that working that way properly. > Thanks in advance for any assistance you can give.. the document > management system looks quite good & I'd love to try it out. Sure, good luck with it. Bryce |
From: Bryce H. <br...@os...> - 2004-02-04 05:52:42
|
Docsys 0.23.5 and Eidetic 2.2.11 are released. These are bugfix releases to fix problems reported by betatesters. See Freshmeat or the change logs for details. Bryce |
From: Bryce H. <br...@os...> - 2004-01-27 21:48:48
|
On Tue, 27 Jan 2004, Bruce C. Dillahunty wrote: > > On Tue, 27 Jan 2004, Bruce C. Dillahunty wrote: > > > The screen is in there, it's the attach.tmpl template in the documents > > directory. It should come up but I also notice the same problem with it > > erroring on ownership. I changed the way the get_owner() routine worked > > recently and it probably busted the call of it in do_attach(). > > > > Looks like around line 2866 a: > if ($owner ne $user->{descriptor} && > $user->{Permissions}->{admin} ne 'Y') { > > might help (stole that from elsewhere in the file) > > It at least gets me past the "not an owner" error. > > Bruce Cool, that's a good fix, I've added it to Eidetic CVS. Thanks! Bryce |
From: Bryce H. <br...@os...> - 2004-01-27 20:02:25
|
On Tue, 27 Jan 2004, Bruce C. Dillahunty wrote: > Ah! OK, now I think I see, kindof... > > If I go to that page, I see your docs... I can create folders and add > documents to those folders!!!! Yeah!!! Congrats :-) > But :-) > > How did you create that first folder? Manually force to the folder add link? The first folder was already there, I added the second folder and then the two documents. I found it by going to this link: http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=folders&command=display&on=0- That showed me a list of all the folders (which was just number 1), so I clicked on that to bring it up. There was an add document icon there, but that didn't work (a bug, probably), so I added a folder, and that worked fine. Then I went to the URL http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=folders&command=display&on=1[2] Then I tried adding a doc to the folder I just created and it worked. So then I added another doc to the first folder to make sure it worked too, and it did. So, the jist is that it looks like the "first time install" needs to be made more streamlined. Oh, I also noticed that the thumbnailing behavior didn't work for the two documents I uploaded. That depends on some extra ImageMagick utils. I'm noticing some odd behaviors here with our install too so it might be a package issue. > I'm confused because I assumed that if I went to > > http://dahak.dnsalias.net:8080/docsys/cgi-bin/docsys.cgi > > As the "home" page of the system, I would see things I could work with... > if I add a document there, it doesn't work. (well, it adds to the > repository, but doesn't "show up" in Apache... Yeah, you're right. We actually had that defaulting to something but it was causing some behaviors we didn't like so pulled that out; we don't use that URL anywhere so didn't think much of it, but you're right that it ought to default to *something* useful. Would you mind putting in a feature request RFE to the docsys sourceforge project for this? > If I got to the display you got up: > > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=folders&command=display&on=1[2] > > Things seem to work... > > Well, I'll play at this level :-) Coolness. For the attachment mechanism I think I left the commands in all the templates but commented out. Look in docsys/templates/folders/ at the display.all.tree.row.tmpl and display.all.tree.folder.tmpl files. You'll see at the bottom of each there's a nasty bit with all the icon img's and command url's on one line (to prevent wrapping). In there you'll see the attach command commented out. When you want to test that, simply uncomment and reinstall. Like I said, the code to make it work is all there, and I don't remember there being any problem with it, but I didn't play with it very thoroughly so don't know if it might have some quirks. Bryce |
From: Bryce H. <br...@os...> - 2004-01-26 23:22:07
|
Eidetic 2.2.8 is released and installed into production on osdlab for the intranet docsys. This release addresses several bugs found during beta testing including: [docsys-881605] "document addition doesn't pick up status properly", [docsys-881609] "editting file without selecting document file doesn't work", [docsys-881610] "editting and displaying folder information ", "Can't remove a folder after it's been emptied of docs", "sort=!uid does not work". Bryce |
From: Bryce H. <br...@os...> - 2004-01-26 22:13:49
|
On Mon, 26 Jan 2004, Bruce C. Dillahunty wrote: > >> Right now, things are kind of working, but not quite. I don't see the > >> "icons" to add things, etc. I found a "add document" link at the top of > >> the header bar in the right pane when I grabbed the CVS version... that > >> works, or seems to, but... I'm not seeing errors in the apache logs. > >> I'll add the debugging stuff you suggested for my other problems and see > >> if that points to anything. > > > > To get the icons to show up make sure you have your apache settings > > correct so that the URL being used for the image paths points to where > > they're installed on your system, e.g. /var/www/docsys/images/ or > > whatever. > > I think that's right... if I go directly to > modules=folders&command=display, I get a nice little menu with icons. I > can also call for the icons directly (path straight to them). > > Comparing my machine to the screenshots, I don't get the "departments" > pane on the right... I don't get any errors about displaying things when I > bring up the plain page (including with DEBUG=3). I removed those dept listings for the generic templates, as they were very OSDL specific. > One thing is that I don't have AuthCookie/AuthTicket running (it says its > optional, but is that the problem?) Yeah, you'll need that too. It's optional in the sense that you may be able to use a different auth system, but required in that you do need to have one (docsys depends on $auth_name getting defined by Apache). I haven't tested anything other than AuthCookie/AuthTicket, so that's the only one I can provide tips for. > This set of error_log mean anything to you? Yup, these are all symptoms of not having an auth system in place for doing logins. > [Mon Jan 26 11:01:50 2004] [error] [client 205.174.22.25] auth_user = > undefined > [Mon Jan 26 11:01:58 2004] [error] [client 205.174.22.25] auth_user = > undefined, referer: > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?command=display&modulename=folders > [Mon Jan 26 11:02:14 2004] [error] [client 205.174.22.25] auth_user = > undefined, referer: > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?command=display&modulename=folders&on=2 > [Mon Jan 26 11:03:49 2004] [error] [client 205.174.22.25] auth_user = > undefined, referer: > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=documents&command=edit&on=&d_resource=folder&d_resource_id=2 > [Mon Jan 26 11:03:49 2004] [error] [client 205.174.22.25] File size: > 19368118, referer: > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=documents&command=edit&on=&d_resource=folder&d_resource_id=2 > [Mon Jan 26 11:03:49 2004] [error] [client 205.174.22.25] Making path > '/home/bdillahu/dms/010/001/en' with permissions 0755, referer: > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=documents&command=edit&on=&d_resource=folder&d_resource_id=2 > [Mon Jan 26 11:03:49 2004] [error] [client 205.174.22.25] Handling file > /tmp/tmp_filename, referer: > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=documents&command=edit&on=&d_resource=folder&d_resource_id=2 > [Mon Jan 26 11:03:49 2004] [error] [client 205.174.22.25] Copying > /tmp/tmp_filename to /home/bdillahu/dms/010/001/en/001., referer: > http://dahak.dnsalias.net:8080/docsys/cgi-bin/auth/docsys.cgi?modulename=documents&command=edit&on=&d_resource=folder&d_resource_id=2 > Bryce |
From: Bryce H. <br...@os...> - 2004-01-26 16:58:34
|
On Thu, 22 Jan 2004, Bruce C. Dillahunty wrote: > Bryce, > > I've was excited to read about your work on the Eidetic DMS on freshmeat > the other day... its so rare to find any type of document management > that can handle the same document in multiple folders (this is just an > obvious need to me, but apparently I'm not the norm :-)). Cool to hear. > Anyway, I've been trying for a couple of days to get this running... I > have things loaded (there are a few mistakes in the instructions on the > names of options to pass to Makefile.PL, easily corrected), but This is > what I get when I go to the page: Ah, sorry about that. Could you send me a patch for correcting the instructions? > Trace: > + _top_(): > + Eidetic::main() [docsys.cgi @ 93]: > + (eval)() [Eidetic.pm @ 4028]: > + Eidetic::dispatch() [Eidetic.pm @ 4084]: > + Eidetic::do_display() [Eidetic.pm @ 595]: > > Error - table name not given for (on ) > > The top title and left menu bar is there, but in the large pane to the > right I get this message... any ideas? What URL are you calling it with? A good test might be something like: /docsys/cgi-bin/docsys.cgi?modulename=folders&command=display&on=0- Bryce |
From: Bryce H. <br...@os...> - 2004-01-26 12:35:59
|
Coolness! Congrats on solving it, that was a strange problem. Do you think there is some additional clarification needed in INSTALL to help folks? Looking forward to the questions. We've been betatesting for a week and found a few small bugs. They're fixed but not yet rolled out (SF has been up and down too much lately). Hopefully we'll get those out Monday. Btw, for doing attachment of documents to multiple folders, while the feature works, I disabled the feature in the current release because I was worried it would confuse folk. I can give tips for reactivating it if you want to try it out once you're up and running; I'd love to get feedback on the concept. Also, I'm not certain the user documentation is good enough so would appreciate input on improving that. Here's my working copy of the manual currently: http://docsys.sourceforge.net/docsys_usage.html Bryce On Sun, 25 Jan 2004, Bruce C. Dillahunty wrote: > Thank you SO much for your help... I think its working now (not getting > the error, anyhow... just have to figure out how to use it :-))... I > don't think I can say what I did to fix it. > > I had downgraded to perl5.6 to try that... when it didn't work, I went > back to 5.8 (been happy with it for other things) and readded the > various modules I needed. > > The biggest difference is I reinstalled docsys with all the cgi-bin > stuff pointed to ....htdocs/docsys/cgi-bin Earlier it had been > ....cgi-bin (my main cgi-bin directory) with a subdirectory of > htdocs/docsys/cgi-bin having about the same contents... it all seemed > happy with that, but, maybe that was it. > > Thanks again... you may hear from me with the next round of questions :-) > > Bruce > > Bryce Harrington wrote: > > Yeah the add document error is something different; I removed that link > > in the latest release. Btw, which release of Eidetic are you using? > > Can you try Eidetic 2.2.0 and the latest release, and see if you get the > > same behavior? That might help us narrow it down to whether it might be > > a bug in Eidetic. > > > > Also, have you run other Perl CGI scripts on the machine? If not, it > > might be worth installing a simple one unrelated to this and see if it > > exhibits the same behavior - that will help narrow down whether it's a > > problem with docsys vs. your environment. > > > > Can you also let me know what versions of Apache, CGI.pm, and what linux > > distro you're on? You can get the version of CGI.pm like this: > > > > $ perl -e 'use CGI; print CGI->VERSION, "\n";' > > 3.00 > > > > > Here are some other things you can try that might help narrow things > > down. These are a bit shot-gun so they may not help at all, but who > > knows: > > > > First, you can set the DEBUG value for Eidetic.pm. Do this by changing > > line 10 in docsys.cgi to this: > > > > my $e = new Eidetic(program_name => $NAME, DEBUG=>3); > > > > If level 3 is too much, set it to 1 or 2. This will fill your Apache > > error log with lots of debug info. > > > > Second, the place where the CGI parameters are getting pulled in is > > around like 396 of Eidetic.pm, in the configure() routine. You can add > > some warnings there to print stuff to stderr like this: > > > > warn("Modulename = '$modulename'\n"); > > > > These will show up in your apache error log. > > > > Third, the CGI object gets created in Eidetic's new() routine, at around > > line 135 or so. I notice it doesn't have a check to make sure the cgi > > object is valid, so if it's possible that there's a problem in your CGI > > environment, it might be worthwhile to try adding extra debug info > > there. For example: > > > > $self->{_cgi} = new CGI; > > my @p = $self->{_cgi}; > > warn("Raw CGI parameters: ", @p, "\n"); > > > > This will tell us a lot; if the params don't show up correctly, then we > > know the problem is in your CGI environment, whereas if they do show up > > correctly, then something else inside docsys is mussing stuff up. > > > > Bryce > > > > On Sun, 25 Jan 2004, Bruce C. Dillahunty wrote: > > > >>>On Sat, 24 Jan 2004, Bruce C. Dillahunty wrote: > >>> > >>> > >>>>Bryce Harrington wrote: > >>>> > >>>>>On Fri, 23 Jan 2004, Bruce C. Dillahunty wrote: > >>>>> > >>>>> > >>>>>>>>Trace: > >>>>>>>>+ _top_(): > >>>>>>>>+ Eidetic::main() [docsys.cgi @ 93]: > >>>>>>>>+ (eval)() [Eidetic.pm @ 4028]: > >>>>>>>>+ Eidetic::dispatch() [Eidetic.pm @ 4084]: > >>>>>>>>+ Eidetic::do_display() [Eidetic.pm @ 595]: > >>>>>>>> > >>>>>>>>Error - table name not given for (on ) > >>>>>>>> > >>>>> > >>>>I'm about out of ideas, except to try backing off to Perl 5.6x... I'm at > >>>>5.8... any idea if that would matter? > >>> > >>>Well, could be worth a shot, but my guess is that it's unlikely to > >>>be the cause of the problem, since I've run it on both 5.6 and 5.8 based > >>>systems without this trouble. > >>> > >> > >>Well, you were right... didn't change anything. > >> > >> > >>>Can you give more information about the problem? The error message is > >>>useful but not really enough for me to figure out what's going on... > >>> > >> > >>I'm not sure. I open the link, and I get that error in the "main pane" on > >>the right... the lefthand menu comes up. > >> > >>If I try any of those choices I get: > >> > >>Trace: > >>+ _top_(): > >>+ Eidetic::main() [docsys.cgi @ 93]: > >>+ (eval)() [Eidetic.pm @ 4028]: > >>+ Eidetic::dispatch() [Eidetic.pm @ 4084]: > >>+ Eidetic::do_search() [Eidetic.pm @ 595]: > >>+ Eidetic::Utility::loadFile() [Eidetic.pm @ 1003]: > >> > >>/usr/share/docsys/templates//search.tmpl does not appear to exist. at > >>/usr/lib/perl5/site_perl/Eidetic/Utility.pm line 72, line 191 > >> > >>Note the name of the template is blank in the path (I think it should be > >>before "search.tmpl". > >> > >>I get this for each of the choices on the left. > >> > >>Clicking "top" gets the first error in this message. > >> > >>Clicking "add document" gets something different, but I think its unrelated: > >> > >>------------- > >>Not Found > >> > >>The requested URL /cgi-bin/auth/eidetic.cgi was not found on this server. > >>-------------- > >> > >>Thanks for all the help. Sorry to bug you... I figure this is some little > >>simple thing (permissions or something) but can't seem to run it down. > >> > >>Bruce > >> > >> > >>>Bryce > >>> > >>> > >> > > > |
From: Bryce H. <br...@os...> - 2003-09-09 23:56:55
|
Hi Kevin, Thanks again for the patch. I've applied it to Sort-Tree and released it as version 1.08 to CPAN. It will show up here as soon as the CPAN mirrors get resynced: http://www.cpan.org/authors/id/B/BR/BRYCE/ I've also put it into SourceForge as part of 'docsys' (the app that the module was developed for). I've posted the file releases as well as checking the codebase into CVS there. http://www.sf.net/projects/docsys/ Bryce On Fri, 22 Aug 2003, WHITE, Kevin wrote: > Hi There, > > I have happily been using Sort::Tree and just today noticed a slight problem > (dare I say bug) with it. > > This is best illustrated with the following script: > > #!/usr/local/bin/perl > > use Sort::Tree; > use Data::Dumper; > > @menu = ( > { > 'id' => '11', > 'parent_id' => '3' > }, > { > 'id' => '1', > 'parent_id' => '0' > }, > { > 'id' => '3', > 'parent_id' => '1' > }, > ); > > @ordered = Sort::Tree::list_to_tree( \@menu, 'id', 'parent_id' ); > print Dumper( \@ordered ) . "\n"; > > The output of this is: > > $VAR1 = [ > { > 'id' => '11', > 'parent_id' => '3' > }, > { > 'kids' => [ > { > 'id' => '3', > 'parent_id' => '1' > } > ], > 'id' => '1', > 'parent_id' => '0' > } > ]; > > Which is problematic. Now I have spent the morning playing about with your > code and I now have a headache (I always hated tree manipulation! :)). The > problem as I see it is that if the root item is not the first in the given > array then strange things like this can occur. > > I had a quick look at DBIx::Tree and made the following alteration to > Sort::Tree: > > *** Tree.pm Fri Aug 22 11:28:10 2003 > --- Tree.pm.new Fri Aug 22 11:27:50 2003 > *************** > *** 128,134 **** > > =cut > sub list_to_tree { > ! my ($list, $idField, $parentField) = @_; > > $idField ||= 'id'; > $parentField ||= 'parent_id'; > --- 128,134 ---- > > =cut > sub list_to_tree { > ! my ($list, $idField, $parentField, $startId) = @_; > > $idField ||= 'id'; > $parentField ||= 'parent_id'; > *************** > *** 136,141 **** > --- 136,155 ---- > > warn "Using id field $idField and parent field $parentField\n" if > DEBUGGING; > > + # If given a startId the find that object in the list and ensure that > + # that is processed first > + if( 1== 0 and defined $startId ) > + { > + for( my $i = 0; $i < scalar @{$list}; $i++ ) > + { > + if( ${$list}[$i]->{$idField} =~ /^$startId$/ ) > + { > + unshift( @{$list}, splice( @{$list}, $i, 1 ) ); > + last; > + } > + } > + } > + > my @tree; > my %index; > # Put objects into a nested tree structure > > ----- > > This allows one to specify what the root object is and then shifts it to the > front of the array and everything is fine now. > > Hope this is some help > > Thanks for your work > > Kevin > |