• Automatic import

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #21262  by tymanthius1
 
The auto import scripts here, will they do something like this:

My wife is a teacher, and keeps hundreds of documents in a folder structure several levels deep, they don't move, usually, but they sometimes get updated. Can I have the script watch her root folder, and automagically import ONLY what has changed since the last scan?

If that can be done, I'm in love. :)
 #21275  by jllort
 
You need metadata to store lastModified date by document, and for each document compare local lastModified date than stored in openkm. If you got a lot of documents will take some time to analyze it. But is possible take a look in java how to get last modified date.
 #21278  by tymanthius1
 
Ok, I can work on that later, as it's not as important.

What about importing the new stuff as it pops in? That's MUCH more important, as most of the info is static, once done.
 #21295  by jllort
 
I do not understand what you're talking about, an example is welcome.
 #21307  by tymanthius1
 
What I want is a directory structure, that my wife uses to save documents, to be periodically scanned, and import new documents to openkm. Other than importing, I don't want those documents moved, or changed.

Wikk these scripts do that?
 #21313  by jllort
 
No exactly but could do with minimal changes. At wiki there're some script which add documents and store metadata with minimal changes you could get something similar.

Recursive importing folder and synch with OpenKM folder structure based on lastModified document date and metadata lastModified date. The only case will not be covered will be when you move folders and documents into. We're finishing desktop sync ( folders synch between openkm and local directories but probably this tool will only be able for professional edition, I'm not sure at the moment ).
 #22678  by joako
 
I found the script I posted in 2011[1] is not working with OpenKM 6. I have modified the script and this appears to be working in my initial tests with OpenKM 6.2.3.
Code: Select all
<?php
$okmurl="http://192.168.3.126:8080/OpenKM/";
$okmid="okmAdmin";
$okmpw="admin";
$impfile = $argv[1];
$filename =  $argv[2];
$folder =  $argv[3];

  // Register WSDL
  $OKMAuth = new SoapClient($okmurl."services/OKMAuth?wsdl");
  $OKMDocument = new SoapClient($okmurl."services/OKMDocument?wsdl");
  $OKMProperty = new SoapClient($okmurl."services/OKMProperty?wsdl");
  $OKMRepository = new SoapClient($okmurl."services/OKMRepository?wsdl");
  $file = $impfile;

  // Login
  $loginResp = $OKMAuth->login(array('user' => $okmid, 'password' => $okmpw));
  $token = $loginResp->return;
  echo "Token: ".$token."<br>";

  // Create document
  $createResp = $OKMDocument->createSimple(array('token' => $token, 'docPath' => "/okm:root/$folder/$filename", 'content' => file_get_contents($file)));
  $newDoc = $createResp->return;
  echo "[DOCUMENT] Path: ".$newDoc->path.", Author: ".$newDoc->author.", Size: ".$newDoc->actualVersion->size."<br>";

  // Category assign
  //$getNodeUuid = $OKMRepository->getNodeUuid(array('token' => $token, 'path' => '/okm:categories/alfa'));
  //$catId = $getNodeUuid->return;
  //$OKMProperty->addCategory(array('token' => $token, 'nodePath' => $newDoc->path, 'catId' => $catId));

  // Logout
  $OKMAuth->logout($token);
?>
[1] http://forum.openkm.com/viewtopic.php?f ... =60#p12456
 #22730  by pavila
 
Which is the problem? Any error or exception?
 #22798  by joako
 
pavila wrote:Which is the problem? Any error or exception?
Sorry I don't really recall. Since I saw in another post that the code for 6.x was not the same for 5.x I didn't focus on that and just worked with the new 6.x code in the Wiki.
 #25544  by kknd
 
jllort wrote:No exactly but could do with minimal changes. At wiki there're some script which add documents and store metadata with minimal changes you could get something similar.

Recursive importing folder and synch with OpenKM folder structure based on lastModified document date and metadata lastModified date. The only case will not be covered will be when you move folders and documents into. We're finishing desktop sync ( folders synch between openkm and local directories but probably this tool will only be able for professional edition, I'm not sure at the moment ).
The OpenKM Sync is a great feature ! Some great !
¿Cuándo estará disponible? please for CM version :D

EDIT: sorry i see now the link :D

http://www.openkm.com/download/desktops ... %206.2.zip

tksssss
 #25552  by jllort
 
Early we will release new version of OpenKM desktop sync to correct some minimal bugs we've found. Anyway do not worry with actual version these are minimal corrections of cases we've found where not take in consideration by logic.
 #53752  by scrumi
 
jllort wrote: Fri Jan 25, 2013 8:49 am I have added here http://wiki.openkm.com/index.php/Utilities with name Crontab simple importer
I'm trying to use this, but it is throwing an error:
Code: Select all
2022-07-29 20:54:08,193 [http-nio-0.0.0.0-8080-exec-15] [] WARN  com.openkm.core.Cron - Error executing crontab task 'Billing Import': bsh.EvalError: Sourced file: inline evaluation of: ``import com.openkm.core.*; import com.openkm.api.*; import java.io.*; import com. . . . '' : The collection, array, map, iterator, or enumeration portion of a for statement cannot be null. : at Line: 13 : in file: inline evaluation of: ``import com.openkm.core.*; import com.openkm.api.*; import java.io.*; import com. . . . '' : for ( File file : fldpath .listFiles ( ) ) {

2022-07-29 20:54:08,198 [http-nio-0.0.0.0-8080-exec-15] [] WARN  com.openkm.core.Cron - Error sending mail: Sourced file: inline evaluation of: ``import com.openkm.core.*; import com.openkm.api.*; import java.io.*; import com. . . . '' : The collection, array, map, iterator, or enumeration portion of a for statement cannot be null. : at Line: 13 : in file: inline evaluation of: ``import com.openkm.core.*; import com.openkm.api.*; import java.io.*; import com. . . . '' : for ( File file : fldpath .listFiles ( ) ) {
Any ideas?
 #53754  by scrumi
 
Turns out this was just a file permissions issue. Nothing really related to openKM at all.
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.