Advertisement
[SOLVED] Autopopulate docman or remository
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Enthusiast
- Posts: 170
- Joined: Tue Sep 27, 2005 6:33 pm
- Location: Maryland
[SOLVED] Autopopulate docman or remository
Does anyone know of an easy method for autopopulating docman with a bunch of files at once? What I'd like to do is assign a category for all the files in a directory (previously FTP'd to that folder), and ignore the description and other fields for now... just use the filename as the title. However, with a set of 200+ files, doing this manually is pretty labor intensive. Being able to import a lot of files at once would be very helpful.
If this isn't possible with docman, are there other file utilities that can do this? Has anyone tried it with remository? Are there other non-Joomla! PHP scripts that could be easily integrated into Joomla! to take advantage of the permission features?
Thanks!
kwc
If this isn't possible with docman, are there other file utilities that can do this? Has anyone tried it with remository? Are there other non-Joomla! PHP scripts that could be easily integrated into Joomla! to take advantage of the permission features?
Thanks!
kwc
Last edited by kwc on Mon Mar 27, 2006 2:54 pm, edited 1 time in total.
Advertisement
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Re: Autopopulate docman or remository
EDIT: see below...
Last edited by mjaz on Tue Apr 04, 2006 6:51 pm, edited 1 time in total.
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
-
- Joomla! Enthusiast
- Posts: 170
- Joined: Tue Sep 27, 2005 6:33 pm
- Location: Maryland
Re: Autopopulate docman or remository
mjaz,
Thanks for the code! I'm not experienced in PHP at all so at this point I'd be hesitant to attempt to implement/debug it.
If you perceive others may have the same need, and you have the time/interest/opportunity to perfect this, by all means I would welcome your contribution. Thanks for your generous offer! At the same time, please don't feel obligated if you decide to not attempt this.
You might consider suggesting to the docman author that this be incorporated into a future release of his code as well.
Regards,
kwc
Thanks for the code! I'm not experienced in PHP at all so at this point I'd be hesitant to attempt to implement/debug it.
If you perceive others may have the same need, and you have the time/interest/opportunity to perfect this, by all means I would welcome your contribution. Thanks for your generous offer! At the same time, please don't feel obligated if you decide to not attempt this.
You might consider suggesting to the docman author that this be incorporated into a future release of his code as well.
Regards,
kwc
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Component: Autopopulate For Docman
EDIT: find v1.1.0 here:http://forum.joomla.org/index.php/topic,64008.0.html
Autopopulate for Docman v1.0.1
Joomla component that automatically adds files from a directory to Docman.
Author: Mjaz Lives [email protected]
http://forum.joomla.org/index.php/topic,48491.0.html
Please don't contact me through email but by using this forum. Suggestions and bug reports are welcome.
This component was tested using Joomla! 1.0.8 and Docman 1.3RC2
Use at own risk!
Backup your Joomla installation and database before usage.
Usage:
1) Install as component
2) FTP your files to your /dmdocuments/ folder
3) Edit 'autopopulate_for_docman.config.php' (Optional)
4) In your Joomla backend, go to Components -> Autopopulate
5) Select files and a category
6) Click New'
7) Go to Components -> Docman -> Documents to edit and publish the entries
8) Repeat 2-7 for more files
Download from the forge:
http://forge.joomla.org/sf/projects/mjaztools
Autopopulate for Docman v1.0.1
Joomla component that automatically adds files from a directory to Docman.
Author: Mjaz Lives [email protected]
http://forum.joomla.org/index.php/topic,48491.0.html
Please don't contact me through email but by using this forum. Suggestions and bug reports are welcome.
This component was tested using Joomla! 1.0.8 and Docman 1.3RC2
Use at own risk!
Backup your Joomla installation and database before usage.
Usage:
1) Install as component
2) FTP your files to your /dmdocuments/ folder
3) Edit 'autopopulate_for_docman.config.php' (Optional)
4) In your Joomla backend, go to Components -> Autopopulate
5) Select files and a category
6) Click New'
7) Go to Components -> Docman -> Documents to edit and publish the entries
8) Repeat 2-7 for more files
Download from the forge:
http://forge.joomla.org/sf/projects/mjaztools
Last edited by mjaz on Tue May 23, 2006 9:45 pm, edited 1 time in total.
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
-
- Joomla! Enthusiast
- Posts: 170
- Joined: Tue Sep 27, 2005 6:33 pm
- Location: Maryland
Re: Autopopulate docman or remository
mjaz,
This is absolutely brilliant. Thanks so much for putting this together -- it worked exceptionally well and did exactly what I needed it to do. What a timesaver!
Recommend uploading this to the Extensions site for all to see!
Thanks again,
kwc
This is absolutely brilliant. Thanks so much for putting this together -- it worked exceptionally well and did exactly what I needed it to do. What a timesaver!
Recommend uploading this to the Extensions site for all to see!
Thanks again,
kwc
- researchtoxic
- Joomla! Ace
- Posts: 1023
- Joined: Fri Mar 03, 2006 3:52 pm
- Location: Macon, GA
- Contact:
Re: Autopopulate docman or remository
I can't even figure out to manually populate remository from the backend. Is there an upload button or do you have to ftp everything?
http://www.netentropy.com - Drupal, Joomla and whatever performance.
-
- Joomla! Apprentice
- Posts: 26
- Joined: Tue Feb 07, 2006 6:22 am
- Location: Portland, OR
-
- Joomla! Apprentice
- Posts: 26
- Joined: Tue Feb 07, 2006 6:22 am
- Location: Portland, OR
Re: Autopopulate docman or remository
one suggestion: maybe use "Assign" instead of "New"...
6. then click Assign to assign the file(s) to the catagory...

6. then click Assign to assign the file(s) to the catagory...

j...
- tobi
- Joomla! Fledgling
- Posts: 4
- Joined: Wed Sep 28, 2005 3:31 pm
- Location: Hitchin - Hertforshire - UK
Re: Autopopulate docman or remository
Sorry, but where can I find the component to download? Or how can I use?
I didn't find any link to get it
Am I fumbling?
I didn't find any link to get it

Am I fumbling?

- kenmcd
- Joomla! Champion
- Posts: 5672
- Joined: Thu Aug 18, 2005 2:09 am
- Location: California
- Contact:
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Re: Autopopulate docman or remository
Glad you like it, I spend most of my sunday on it. It's already in Extensions: http://extensions.joomla.org/component/ ... Itemid,35/kwc wrote: This is absolutely brilliant. Thanks so much for putting this together -- it worked exceptionally well and did exactly what I needed it to do. What a timesaver!
Recommend uploading this to the Extensions site for all to see!
Great suggestion, though not enough to justify a 1.0.1 release ;-) Keep posting feature requests, if a lot of people use this comp, I'll spend another sunday on it.joevv3 wrote: one suggestion: maybe use "Assign" instead of "New"...
6. then click Assign to assign the file(s) to the catagory...
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
- tobi
- Joomla! Fledgling
- Posts: 4
- Joined: Wed Sep 28, 2005 3:31 pm
- Location: Hitchin - Hertforshire - UK
Re: Autopopulate docman or remository
:P
thank you
I didn't behold
thank you

I didn't behold

-
- Joomla! Fledgling
- Posts: 2
- Joined: Wed Mar 29, 2006 9:55 am
Autopopulate docman or remository
I've been hanging out for this feature for Docman... excellent component... brilliant idea.
Thanks for making my life that little bit easier.
Rubes.
Thanks for making my life that little bit easier.
Rubes.

-
- Joomla! Fledgling
- Posts: 1
- Joined: Mon Apr 03, 2006 11:00 am
Re: [SOLVED] Autopopulate docman or remository
Will this work on ""old" Mambo sites I can not change yet to joomla???
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Re: [SOLVED] Autopopulate docman or remository
I have no idea, I only joined at 1.0.3. You could test in on a local installation. In any case, I don't think the component can do any harm whatsoever, but making backups of your site and your database is a good habit.arthurvdmolen wrote: Will this work on ""old" Mambo sites I can not change yet to joomla???

Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue Apr 04, 2006 8:30 am
Re: [SOLVED] Autopopulate docman or remository
I cannot download this zip File.
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Re: [SOLVED] Autopopulate docman or remository
I think the forum requires you to be logged in to download.
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
- pointri
- Joomla! Explorer
- Posts: 283
- Joined: Wed Aug 24, 2005 2:02 pm
- Location: Rhode Island, USA
Re: [SOLVED] Autopopulate docman or remository
Maybe I've been hanging around in Joomlapolis too long, but I'd give you 'Karma' if I could. I've got about 100 pdfs uploaded vis mosCE I need to load into DocMan and it's going to save me a lot of time. Thanks for putting it together!
Here's a feature request that might be relatively easy and could qualify as a motive for a 1.0.1: A recursive drill-down of the documents contained within the default 'files' directory you're searching through. Bonus points (or karma...whatever...) if you can call it back as a file tree rather than a flat list.
Here's a feature request that might be relatively easy and could qualify as a motive for a 1.0.1: A recursive drill-down of the documents contained within the default 'files' directory you're searching through. Bonus points (or karma...whatever...) if you can call it back as a file tree rather than a flat list.
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Files a tree
Displaying files as a tree should be simple. However, AFAIK, Docman doesn't currently support subdirectories in /dmdocuments. What I could do is have the component move all files from the subdirectories to the /dmdocuments-root, rename them (eg. "subdir_filename.ext") and create subcategories that reflect the original directory structure. I'd have to find a way to keep it simple, so the component is can be used without reading a manual. Let me know what you think.pointri wrote: Here's a feature request that might be relatively easy and could qualify as a motive for a 1.0.1: A recursive drill-down of the documents contained within the default 'files' directory you're searching through. Bonus points (or karma...whatever...) if you can call it back as a file tree rather than a flat list.
Glad to helppointri wrote: Maybe I've been hanging around in Joomlapolis too long, but I'd give you 'Karma' if I could.


Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
- pointri
- Joomla! Explorer
- Posts: 283
- Joined: Wed Aug 24, 2005 2:02 pm
- Location: Rhode Island, USA
Moving files...
That would be okay, except that shifting all of the documents up to one directory would break the links to those same files generated in content items. Since it looks like DocMan stores file information in a database table, and the file name is stored as a URL, would it be possible to loop recursively through a file directory and build an array of those file URLs to select from? Here's a function I found in the PHP manual that might do the job with a little tweaking to prepend $mosConfig_live_site and build it into an option list...mjaz wrote: What I could do is have the component move all files from the subdirectories to the /dmdocuments-root, rename them (eg. "subdir_filename.ext") and create subcategories that reflect the original directory structure. I'd have to find a way to keep it simple, so the component is can be used without reading a manual. Let me know what you think.
Code: Select all
<?php
// $path : path to browse
// $maxdepth : how deep to browse (-1=unlimited)
// $mode : "FULL"|"DIRS"|"FILES"
// $d : must not be defined
function searchdir ( $path , $maxdepth = -1 , $mode = "FULL" , $d = 0 )
{
if ( substr ( $path , strlen ( $path ) - 1 ) != '/' ) { $path .= '/' ; }
$dirlist = array () ;
if ( $mode != "FILES" ) { $dirlist[] = $path ; }
if ( $handle = opendir ( $path ) )
{
while ( false !== ( $file = readdir ( $handle ) ) )
{
if ( $file != '.' && $file != '..' )
{
$file = $path . $file ;
if ( ! is_dir ( $file ) ) { if ( $mode != "DIRS" ) { $dirlist[] = $file ; } }
elseif ( $d >=0 && ($d < $maxdepth || $maxdepth < 0) )
{
$result = searchdir ( $file . '/' , $maxdepth , $mode , $d + 1 ) ;
$dirlist = array_merge ( $dirlist , $result ) ;
}
}
}
closedir ( $handle ) ;
}
if ( $d == 0 ) { natcasesort ( $dirlist ) ; }
return ( $dirlist ) ;
}
?>
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Re: Moving files...
If you change the dmfilename field in the #__docman table, eg to subdir/myfile.ext, then docman has some trouble when a user tries to download the file. So using the original paths in dmfilename would require docman core files to be patched.pointri wrote:That would be okay, except that shifting all of the documents up to one directory would break the links to those same files generated in content items. Since it looks like DocMan stores file information in a database table, and the file name is stored as a URL, would it be possible to loop recursively through a file directory and build an array of those file URLs to select from? Here's a function I found in the PHP manual that might do the job with a little tweaking to prepend $mosConfig_live_site and build it into an option list...
In your case, you could always use doclink to link to files in your content, instead of using direct links to files in subdirs.
Thanks for the code, but I'll probably make the next version for Joomla 1.5 only, so I can use the new framework with the ftp-filesystem etc.
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
- Rafmeister
- Joomla! Apprentice
- Posts: 44
- Joined: Mon Apr 03, 2006 5:52 pm
- Location: Blackpool, UK
- Contact:
Re: [SOLVED] Autopopulate docman or remository
Can anyone answer me this ??
On my v1.0.8 J installation "Autopopulate" works like a dream (I applaude you!), but on my v1.0.3-upgraded-to-v1.0.8 J installation it says on a blank white screen "Problem opening".
Can anyone tell me how to get this working on my upgraded site??
Thanks people
On my v1.0.8 J installation "Autopopulate" works like a dream (I applaude you!), but on my v1.0.3-upgraded-to-v1.0.8 J installation it says on a blank white screen "Problem opening".
Can anyone tell me how to get this working on my upgraded site??
Thanks people

- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Re: [SOLVED] Autopopulate docman or remository
Autopop can't find the path to your docman files.Rafmeister wrote: but on my v1.0.3-upgraded-to-v1.0.8 J installation it says on a blank white screen "Problem opening".
Go to Components / Docman / Configuration and make sure that the 'Path for storing files' is correctly set to an existing path on your site. Usually something like 'var/usr/www/dmdocuments'. Save your config.
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
- Rafmeister
- Joomla! Apprentice
- Posts: 44
- Joined: Mon Apr 03, 2006 5:52 pm
- Location: Blackpool, UK
- Contact:
Re: [SOLVED] Autopopulate docman or remository
Thanks for replying, however the path is correct or at least in my eyes it is.
I'm using the default path of /home/rafnet/public_html/v2/dmdocuments which is exactly where the files are stored, could it be something to do with this site being an upgraded v1.0.3 installation as the v1.0.8 full package installation I also use works perfectly?
Thanks for trying, but I desperately don't want to revert back to ReMOSitory as the process of adding files is laborious to say the least, so any further help would be very much appreciated.

I'm using the default path of /home/rafnet/public_html/v2/dmdocuments which is exactly where the files are stored, could it be something to do with this site being an upgraded v1.0.3 installation as the v1.0.8 full package installation I also use works perfectly?
Thanks for trying, but I desperately don't want to revert back to ReMOSitory as the process of adding files is laborious to say the least, so any further help would be very much appreciated.

- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
Re: [SOLVED] Autopopulate docman or remository
That is possible, but I still think the problem lies elsewhere.Rafmeister wrote: could it be something to do with this site being an upgraded v1.0.3 installation as the v1.0.8 full package installation I also use works perfectly?
- Are you sure you're using Docman v1.3 RC2?
- Autopop only generates a "Problem Opening" message when it can't open dmdocuments. Take a look at /administrator/components/com_docman/docman.config.php
There should be a line like this:
Code: Select all
var $dmpath = "/home/rafnet/public_html/v2/dmdocuments";
- Check the chmod and owner permissions for /dmdocuments
Good luck!
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
-
- Joomla! Explorer
- Posts: 312
- Joined: Thu Oct 06, 2005 4:43 pm
Re: [SOLVED] Autopopulate docman or remository
thanks for a great extension!
saves me sooo much trouble.
just one feature request: would it be possible to add the same doc to diff categories? right now, once i assign a doc to a cat, it disappears from the list.
thanks,
-V

just one feature request: would it be possible to add the same doc to diff categories? right now, once i assign a doc to a cat, it disappears from the list.
thanks,
-V
- mjaz
- Joomla! Guru
- Posts: 821
- Joined: Thu Nov 10, 2005 10:08 am
- Contact:
hack file list
Open admin.autopopulate_for_docman.php and change this line:maddunr wrote: would it be possible to add the same doc to diff categories? right now, once i assign a doc to a cat, it disappears from the list.
Code: Select all
$FilesInDatabase = Autopopulate::GetFilesInDatabase();
Code: Select all
$FilesInDatabase = array();
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework
-
- Joomla! Explorer
- Posts: 312
- Joined: Thu Oct 06, 2005 4:43 pm
Re: [SOLVED] Autopopulate docman or remository
sweeeeeeet!
- V
- V
- nathandiehl
- Joomla! Champion
- Posts: 6044
- Joined: Fri Aug 19, 2005 3:03 pm
- Location: Indiana, USA
- Contact:
Re: [SOLVED] Autopopulate docman or remository
thank you very much. this was extrememly helpful.
If you're new to Joomla, Please read Anna's Joomla! Tips: http://forum.joomla.org/viewtopic.php?t=5503
http://nathandiehl.com | Find out what makes me tick
http://nathandiehl.com | Find out what makes me tick
-
- Joomla! Apprentice
- Posts: 8
- Joined: Fri Feb 17, 2006 6:24 pm
Re: [SOLVED] Autopopulate docman or remository
I have needed this feature in Joomla for 6 months now. Of course when I go to use it it doesnt work.
Anyhow, enough crying.
Installed as per instructions.
When I go to components--->autopopulate
I get this output in my Joomla backend. All my normal Joomla backend is there, but the buttons for this component are not. They get errors as well.
Hopefully this isnt a php5 issue. I have no choice in that matter.
Anyhow, enough crying.
Installed as per instructions.
When I go to components--->autopopulate
I get this output in my Joomla backend. All my normal Joomla backend is there, but the buttons for this component are not. They get errors as well.
Hopefully this isnt a php5 issue. I have no choice in that matter.
getPath( 'admin_html' ) ); require_once( $mainframe->getPath( 'class' ) ); require_once ($mosConfig_absolute_path . '/administrator/components/com_docman/docman.config.php'); require_once ($mosConfig_absolute_path . '/administrator/components/com_autopopulate_for_docman/autopopulate_for_docman.config.php'); $dmConfig = new dmConfig(); $AConf = new AutopopulateConf(); switch ($task) { case "new" : tasknew(); break; default: taskdefault(); break; } function taskdefault() { global $dmConfig, $AConf, $option; $files = false; $FilesInDatabase = Autopopulate::GetFilesInDatabase(); //files that already have a doc entry $Categories = Autopopulate::GetCategories(); $handle = opendir($dmConfig->dmpath) or die ("Problem opening " . $dmConfig->dmpath); while (false !== ($file = readdir($handle))) { if ( (!in_array($file, $AConf->skipfiles)) AND (!in_array($file, $FilesInDatabase))) { $files[] = $file; } } if (!$files) { echo "All files in ".$dmConfig->dmpath." are already present in the docman database"; } else { sort($files); HTML_Autopopulate::taskdefault($option, $files, $dmConfig, $Categories); }; } function tasknew() { global $database, $dmConfig, $AConf; $files = mosGetParam( $_POST, 'files', false ); $catid = mosGetParam( $_POST, 'catid', 0 ); $msg = ""; if (!$files) { echo "No files selected"; return false; } foreach ($files as $file) { $database->setQuery( "INSERT INTO `#__docman` SET `dmfilename` = '".$file."', `dmname` = '".$file."', `catid` = '".$catid."', `dmdescription` = '".$AConf->dmdescription."', `dmdate_published` = '".$AConf->dmdate_published."', `dmowner` = '".$AConf->dmowner."', `published` = '".$AConf->published."', `dmurl` = '".$AConf->dmurl."', `dmcounter` = '".$AConf->dmcounter."', `checked_out` = '".$AConf->checked_out."', `checked_out_time` = '".$AConf->checked_out_time."', `approved` = '".$AConf->approved."', `dmthumbnail` = '".$AConf->dmthumbnail."', `dmlastupdateon` = '".$AConf->dmlastupdateon."', `dmlastupdateby` = '".$AConf->dmlastupdateby."', `dmsubmitedby` = '".$AConf->dmsubmitedby."', `dmmantainedby` = '".$AConf->dmmantainedby."', `dmlicense_id` = '".$AConf->dmlicense_id."', `dmlicense_display` = '".$AConf->dmlicense_display."', `access` = '".$AConf->access."', `attribs` = '".$AConf->attribs."' ;" ); if (!$database->query()) { $msg[$file] = "". $database->getErrorMsg() .""; } else { $msg[$file] = "Added to database"; } } HTML_Autopopulate::tasknew($msg); } ?>
Advertisement