File system document?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

File system document?

Post by hpl123 »

Hi all,
I´m trying to figure out how the file system document attribute option (i.e using local server files instead of DB files for document attributes) works. Has anyone used this option successfully and can share how it´s done?
Thanks
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: File system document?

Post by hpl123 »

hpl123 wrote:Hi all,
I´m trying to figure out how the file system document attribute option (i.e using local server files instead of DB files for document attributes) works. Has anyone used this option successfully and can share how it´s done?
Thanks
Or support, if you could provide some pointers. Thanks
Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

The attribute that stores the path of the document must have the correct path for the instance of the object being saved. How the path is set into this attribute is entirely up to you. In most cases you would have a rule that would set a path depending on some other attributes of the object.
Aware IM Support Team
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

THX

Post by hpl123 »

Thanks support,
I have tried to do just that but haven´t succeeded. I will test some more.
Henrik (V8 Developer Ed. - Windows)
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Post by weblike »

Hi hlp123,

Have you succeeded with this?
I'm trying to use this option but no luck.
My scenario is as follows:
I have UserDefDocs with Ms Word Documents as templates
With a process I export the UserDefDoc to a specified Path. (c:\Invoices

EXPORT DOCUMENT InvoiceBO.InvoiceDocument.UDD_Name TO FILE '<<InvoiceBO.PDFInvoice_Path>>/<<InvoiceBO.InvoiceNumber>>.doc'
EXECUTE PROGRAM '<<SystemSettings.InstallPath>>\thirdpartyPDFconverter.exe <<InvoiceBO.PDFInvoice_Path>>\<<InvoiceBO.InvoiceNumber>>.doc'

Everything is ok for above rules. I can see the created PDF file.

Now I want to import it to FileSystem and I entered the rule bellow:

IMPORT DOCUMENT InvoiceBO.PDFInvoice FROM '<<InvoiceBO.PDFInvoice_Path>>\<<InvoiceBO.InvoiceNumber>>.pdf'

but I get the following error:


Internal system errorTransaction exception Unable to write document into file system. Exception message C:\Invoices (Access is denied). File path C:\Invoices may be invalid
C:\Invoices is a folder which exists....

Thank you.
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
kklosson
Posts: 1628
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Post by kklosson »

Try setting the path to ...\AwareIM\Tomcat\Webapps\AwareIM\Temp

...assumes no paths changed from standard installation.
...you have to create the Temp folder first
...you may choose to create and use subfolders at this location
...I find that my app can't create the Temp folder but it can create the subfolders, go figure

Rationale: I don't think that Tomcat can write to the C: drive, AFAIK. Plus, if you call a file from a URL, it will have to be in a location relevant to the webapp path like this.
RentProperty
Posts: 345
Joined: Mon Nov 12, 2012 9:08 pm
Location: South Africa

Post by RentProperty »

Dear Weblike

I'm very interested to know what this thirdPartyPDFConverter is that you have used and how to implement this as I have a similar need to convert Doc's to PDF automatically. Would you mind sharing your expertize? Will be MUCH appreciated.

Kindest Regards

Hein
Hein Hanekom & Werner Hanekom
Sinov8.net
AwareIM Version 5.9 | 6.0 | 7.0 | 7.1 (Windows EC2 R2012 & MySQL)
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Post by weblike »

Hi there,

Of course. Gladly to share. I'm implementing 7PDF Maker from http://www.7-pdf.de/produkte/7-pdf-maker. I have installed it on C:\7PDF path to be easier.
Just keep in mind that 7PDF doesn't allow spaces in Folder Names/document names, but you can avoid this with REPLACE PATTERN function.

Then Execute Command is as I wrote above.
If you need further advices, please let me know.

Now I'm playing with file system documents as I don't want to keep PDF documents in DB.
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Guide

Post by hpl123 »

weblike wrote:Hi hlp123,

Have you succeeded with this?
I'm trying to use this option but no luck.
My scenario is as follows:
I have UserDefDocs with Ms Word Documents as templates
With a process I export the UserDefDoc to a specified Path. (c:\Invoices

EXPORT DOCUMENT InvoiceBO.InvoiceDocument.UDD_Name TO FILE '<<InvoiceBO.PDFInvoice_Path>>/<<InvoiceBO.InvoiceNumber>>.doc'
EXECUTE PROGRAM '<<SystemSettings.InstallPath>>\thirdpartyPDFconverter.exe <<InvoiceBO.PDFInvoice_Path>>\<<InvoiceBO.InvoiceNumber>>.doc'

Everything is ok for above rules. I can see the created PDF file.

Now I want to import it to FileSystem and I entered the rule bellow:

IMPORT DOCUMENT InvoiceBO.PDFInvoice FROM '<<InvoiceBO.PDFInvoice_Path>>\<<InvoiceBO.InvoiceNumber>>.pdf'

but I get the following error:


Internal system errorTransaction exception Unable to write document into file system. Exception message C:\Invoices (Access is denied). File path C:\Invoices may be invalid
C:\Invoices is a folder which exists....

Thank you.
I found another way to go about the thing I wanted so I never really got anywhere with this. I did try though and could never really get it to work. If you (or other) developers get this working: a short guide to replicate in our own applications would be appreciated. Thanks
Henrik (V8 Developer Ed. - Windows)
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Post by weblike »

Hi hpl123,

Thanks for your reply.

I have tried to do what kklosson suggested. I have created a Temp folder in \AwareIM\Tomcat\Webapps\RenamedFolder\Temp

Also tried with existing \AwareIM\Tomcat\Webapps\RenamedFolder\TEMP_RESOURCES

but no luck....I get same error:


Internal system errorTransaction exception Unable to write document into file system. Exception message C:\AwareIM\Tomcat\webapps\APPS\TEMP_RESOURCES (Access is denied). File path C:\AwareIM\Tomcat\webapps\APPS\TEMP_RESOURCES may be invalid



I have searched in userguide but no examples.
If anyone managed to deal with this will be much appreciated if share with us...
Support, can you give a helping advice(example) here?This will be also be much appreciated.

Thank you
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
RentProperty
Posts: 345
Joined: Mon Nov 12, 2012 9:08 pm
Location: South Africa

Post by RentProperty »

weblike wrote:Hi there,

Of course. Gladly to share. I'm implementing 7PDF Maker from http://www.7-pdf.de/produkte/7-pdf-maker. I have installed it on C:\7PDF path to be easier.
Just keep in mind that 7PDF doesn't allow spaces in Folder Names/document names, but you can avoid this with REPLACE PATTERN function.

Then Execute Command is as I wrote above.
If you need further advices, please let me know.

Now I'm playing with file system documents as I don't want to keep PDF documents in DB.
Thank you So much WebLike!! Downloaded it and got it working in no time using the Sytax you described. This is going to make it alot easier to design nice looking reports in WORD and converting to PDF rather than Designing with The Report Designer.
Hein Hanekom & Werner Hanekom
Sinov8.net
AwareIM Version 5.9 | 6.0 | 7.0 | 7.1 (Windows EC2 R2012 & MySQL)
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Post by weblike »

Glad could help...

How do you store your documents in DB or in file system???
I'm not getting anywhere with storing documents in File System... I know i'm missing a little stuff here, but I can't figure it out....

thx.
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
RentProperty
Posts: 345
Joined: Mon Nov 12, 2012 9:08 pm
Location: South Africa

Post by RentProperty »

weblike wrote:Glad could help...

How do you store your documents in DB or in file system???
I'm not getting anywhere with storing documents in File System... I know i'm missing a little stuff here, but I can't figure it out....

thx.
Hi Weblike, no sorry I am still using DB storage so haven't got round to play with the file system yet, but will let you know if I do and I get it working. Might need it soon.

Kind Regards

Hein
Hein Hanekom & Werner Hanekom
Sinov8.net
AwareIM Version 5.9 | 6.0 | 7.0 | 7.1 (Windows EC2 R2012 & MySQL)
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Post by weblike »

Bingo my friends...
I have achieved to do what I wanted...after few days of reading user-guide, forum posts and lot of testing.

I post here my experience with File system if anyone will need it:

The process is like this
EXPORT DOCUMENT InvoiceBO.InvoiceDocument.UDD_Name TO FILE '<<InvoiceBO.PDFInvoice_Path>>/<<InvoiceBO.InvoiceNumber>>.doc'
EXECUTE PROGRAM '<<SystemSettings.InstallPath>>\thirdpartyPDFconverter.exe <<InvoiceBO.PDFInvoice_Path>>\<<InvoiceBO.InvoiceNumber>>.doc'
IMPORT DOCUMENT InvoiceBO.PDFInvoice FROM '<<InvoiceBO.PDFInvoiceImportPath>>'


This is the trick.
You have to declare another File Path which includes the PDF file too(example: C:\AwareIM\Invoices\Invoice001.pdf). I have created attribute <<PDFInvoiceImportPath>>
With a rule in BO you have to instert the value of the full path in this attribute and the IMPORT DOCUMENT will wok.

Kind regards..
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

THX

Post by hpl123 »

weblike wrote:Bingo my friends...
I have achieved to do what I wanted...after few days of reading user-guide, forum posts and lot of testing.

I post here my experience with File system if anyone will need it:

The process is like this
EXPORT DOCUMENT InvoiceBO.InvoiceDocument.UDD_Name TO FILE '<<InvoiceBO.PDFInvoice_Path>>/<<InvoiceBO.InvoiceNumber>>.doc'
EXECUTE PROGRAM '<<SystemSettings.InstallPath>>\thirdpartyPDFconverter.exe <<InvoiceBO.PDFInvoice_Path>>\<<InvoiceBO.InvoiceNumber>>.doc'
IMPORT DOCUMENT InvoiceBO.PDFInvoice FROM '<<InvoiceBO.PDFInvoiceImportPath>>'


This is the trick.
You have to declare another File Path which includes the PDF file too(example: C:\AwareIM\Invoices\Invoice001.pdf). I have created attribute <<PDFInvoiceImportPath>>
With a rule in BO you have to instert the value of the full path in this attribute and the IMPORT DOCUMENT will wok.

Kind regards..
Great stuff, thanks for sharing.
Henrik (V8 Developer Ed. - Windows)
Post Reply