Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error using addoc on CLI
#1
I am trying to add a file using this command;
[eric@pepper /usr/share/letodms] $ sudo /usr/share/letodms/utils/letodms-adddoc -F 6 -f ~/foobar.doc
PHP Fatal error: Call to a member function isAdmin() on a non-object in /usr/share/php/LetoDMS/Core/inc.ClassFolder.php on line 759

$ dpkg -l letodms:
ii letodms 3.3.4+dfsg-1 all document management system based on PHP and MySQL

Thanks Uwe for letodms.

Eric Smith
Reply
#2
(11-09-2012, 09:41 AM)ericsmythe Wrote: I am trying to add a file using this command;
[eric@pepper /usr/share/letodms] $ sudo /usr/share/letodms/utils/letodms-adddoc -F 6 -f ~/foobar.doc
PHP Fatal error: Call to a member function isAdmin() on a non-object in /usr/share/php/LetoDMS/Core/inc.ClassFolder.php on line 759

$ dpkg -l letodms:
ii letodms 3.3.4+dfsg-1 all document management system based on PHP and MySQL

That looks like there is no user object. It is created very early in the adddoc.php script. Search for 'dms->getUser'. adddoc.php uses a fixed user id. Maybe you have deleted that user.

Uwe
Reply
#3

[/quote]

That looks like there is no user object. It is created very early in the adddoc.php script. Search for 'dms->getUser'. adddoc.php uses a fixed user id. Maybe you have deleted that user.

Uwe
[/quote]

Thanks Uwe

You were right on. I did something on-standard with the install and missed that user ID. It works now! That is so cool.
Except there is an error when trying to delete the document through the web interface - oops. I can move the doc to another folder, but then cannot delete that container folder then, either.

I will restart with a new database and see how it goes.

Is it possible to have two letodms databases functioning on the same system. I want to run then under alternate virtual domains.

Thanks

Eric
Reply
#4

That looks like there is no user object. It is created very early in the adddoc.php script. Search for 'dms->getUser'. adddoc.php uses a fixed user id. Maybe you have deleted that user.

Uwe
[/quote]

You were right on. I did something on-standard with the install and missed that user ID. It works now! That is so cool.
Except there is an error when trying to delete the document through the web interface - oops. I can move the doc to another folder, but then cannot delete that container folder then, either.

I will restart with a new database and see how it goes.

Is it possible to have two letodms databases functioning on the same system. I want to run then under alternate virtual domains.

[/quote]

Sure. Just make two installations and give them its own database.
You could even use the same source and just have seperate databases and content directories. The README has a section on it 'CONFIGURING MULTIPLE INSTANCES'

Uwe
Reply
#5

Sure. Just make two installations and give them its own database.
You could even use the same source and just have seperate databases and content directories. The README has a section on it 'CONFIGURING MULTIPLE INSTANCES'

Uwe

Thanks Uwe

That all works indeed as you indicate.


I do not have the failure to delete issue with my clean db.
One issue I have noticed is that when using adddoc from the shell, is that the documents do not have a "View Online" option as they do when I add them via the GUI.
Is this a known issue?

What are the other tasks that are "safe" to perform on the commandline?

Eric
Reply
#6
(11-10-2012, 04:52 AM)ericsmythe Wrote: I do not have the failure to delete issue with my clean db.
One issue I have noticed is that when using adddoc from the shell, is that the documents do not have a "View Online" option as they do when I add them via the GUI.
Is this a known issue?
Historically each version of a document has a filetype and a mimetype. The filetype is basically the extension of the file you uploaded or inserted with adddoc. So it depends on the filename. Whether a version can be viewed online or not depends on the filetype and not on the mimetype.
adddoc doesn't set the filetype but only the mimetype. I should fix this.
A much cleaner solution would be to get rid of the filetype and stick with the mimetype only.

(11-10-2012, 04:52 AM)ericsmythe Wrote: What are the other tasks that are "safe" to perform on the commandline?
To be honest, none of the commandline tools are officially safe, but adddoc is one of them that is around for some time and there weren't
many complains about it.

The indexer.php is safe because it is just a thin layer above the LetoDMS Indexer class.

Uwe
Reply
#7
(11-10-2012, 04:51 PM)steinm Wrote: Historically each version of a document has a filetype and a mimetype. The filetype is basically the extension of the file you uploaded or inserted with adddoc. So it depends on the filename. Whether a version can be viewed online or not depends on the filetype and not on the mimetype.
adddoc doesn't set the filetype but only the mimetype. I should fix this.
A much cleaner solution would be to get rid of the filetype and stick with the mimetype only.

Uwe

I understand. I would like to find a temporary fix (IOW hack) until this is supported.
I tried:
mysql> UPDATE tblDocumentContent SET mimeType = 'image/png', fileType = '.PNG' where document = '17';

That just left an ugly icon and nothing clickable to Download or View Online. What else do I need to do for a View Online of documents uploaded with adddoc?

Thanks
Eric
Reply
#8
(11-10-2012, 07:14 PM)ericsmythe Wrote: I tried:
mysql> UPDATE tblDocumentContent SET mimeType = 'image/png', fileType = '.PNG' where document = '17';

That just left an ugly icon and nothing clickable to Download or View Online. What else do I need to do for a View Online of documents uploaded with adddoc?

Try '.png' instead of '.PNG'. The change in adddoc is basically the line where the document is added with addDocument(). The empty string in that method call must be the file type.

Uwe
Reply
#9
Uwe

Hardcoding the .PNG did solve this issue and this works.
However I still encountred some errors in deleting documents added through the adddoc on CLI. Error reported was incorrect Document ID. Getting there.

I have decided to upgrade to version 3.4 and test from a clean db in 3.4.

I want to set up two installations on two different virtual domains.
This apache2 conf points correctly to my current install for now:
Alias /dms "/usr/share/letodms"
<Directory "/usr/share/letodms">
Options -Indexes MultiViews FollowSymLinks
Redirect /letodms/conf/settings.xml http://www.trustfood.org/dms/
AllowOverride None
Order deny,allow
Allow from all
</Directory>

What is the recommended way to set up the referral to the seperate installations (settings.xml / content directories)?
Should I have alternate /etc/letodms/settings.xml?
Then do I need to have seperate /usr/share/letodms hierarchies. Because I notics that the settings.xml is a link to the one in /etc /letodms?
Reply
#10
(11-11-2012, 06:42 AM)ericsmythe Wrote: Uwe

Hardcoding the .PNG did solve this issue and this works.
However I still encountred some errors in deleting documents added through the adddoc on CLI. Error reported was incorrect Document ID. Getting there.

I have decided to upgrade to version 3.4 and test from a clean db in 3.4.

I want to set up two installations on two different virtual domains.
This apache2 conf points correctly to my current install for now:
Alias /dms "/usr/share/letodms"
<Directory "/usr/share/letodms">
Options -Indexes MultiViews FollowSymLinks
Redirect /letodms/conf/settings.xml http://www.trustfood.org/dms/
AllowOverride None
Order deny,allow
Allow from all
</Directory>

What is the recommended way to set up the referral to the seperate installations (settings.xml / content directories)?
Should I have alternate /etc/letodms/settings.xml?
Then do I need to have seperate /usr/share/letodms hierarchies. Because I notics that the settings.xml is a link to the one in /etc /letodms?

You can set up a second directory like /usr/share/letodms but put soft links into that directories pointing to the directories in /usr/share/letodms. Just leave out the conf directory. The conf directory should contain the settings.xml for the new installation or a link to a settings file in /etc/letodms. The content directory may be anywhere e.g. /var/lib/letodms/

Uwe
Reply


Forum Jump:


Users browsing this thread: