transferring document

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

transferring document

Post by crisg0112 »

Hi,

How do I transfer a document type from one BO (app_A) to another BO (app_B)?

Basically, the user uploads the document in app_A and I have a scheduled process that grabs all the uploaded files in app_A then copies the document in app_B
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: transferring document

Post by tford »

Are you creating a new instance of app_B or do you need to find a particular instance of app_B to copy the doc to?
Tom - V8.8 build 3137 - MySql / PostGres
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

Re: transferring document

Post by crisg0112 »

tford wrote:Are you creating a new instance of app_B or do you need to find a particular instance of app_B to copy the doc to?
Hi Tom,

creating a new instance on App_B
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
kklosson
Posts: 1628
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: transferring document

Post by kklosson »

ObjectB.Doc=ObjectA.Doc
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: transferring document

Post by tford »

To create a new instance, very similar to the one above:

CREATE ObjectB WITH ObjectB.Doc=ObjectA.Doc
Tom - V8.8 build 3137 - MySql / PostGres
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

Re: transferring document

Post by crisg0112 »

tford wrote:To create a new instance, very similar to the one above:

CREATE ObjectB WITH ObjectB.Doc=ObjectA.Doc
Thanks Kingsley and Tom.

Let me explain the whole process

1) App_A is used by guest logon. Here they upload all the files they want.

2) App_B is use by the registered users.
The way App_B reads App_A data is by defining the Business Objects of App_A as an external database.

App_A has a BO called FileUploads with attribute:
FileSize (Number)
FileUploaded (Document)

App_B has the following BO's

ValidFileUploads (internal awareim)
  1. FileSize (Number)
    ValidFile (Document)
    DateChecked (Date)
ext_FileUploads (this BO is from App_A)
  1. EXT_ID
    EXT_BASVERSION
    EXT_BASTIMESTAMP
    FIleUploaded_DOCDATA (binary data)
    FileUploaded_DOCTYPE (plain text)
    FileSize
Using CREATE ValidFileUploads WITH ValidFileUploads.ValidFile=ext_FileUploads.FileUploaded_DOCDATA doesn't work, it just creates a record but the document is not created.
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
kklosson
Posts: 1628
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: transferring document

Post by kklosson »

I assume "doesn't work" means that no data is entered into the doc attribute. I recommend you try any process to copy the blob from one database to the other. I'm out of my depth in any difference between MSSQL and MySQL blob data, but it could be a factor. I don't know if MSSQL has more than one blob type either. But I suggest Googling on the the differences between the databases as far as blobs go.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

Re: transferring document

Post by crisg0112 »

kklosson wrote:I assume "doesn't work" means that no data is entered into the doc attribute. I recommend you try any process to copy the blob from one database to the other. I'm out of my depth in any difference between MSSQL and MySQL blob data, but it could be a factor. I don't know if MSSQL has more than one blob type either. But I suggest Googling on the the differences between the databases as far as blobs go.
Hi Kingsley,

looks like you're right, transferring binary data in MSSQL (using SP) is not as simple as it seems but doable. And how to do it in Aware is another thing.
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Re: transferring document

Post by RLJB »

Hey Chris, don't store it as a blob, put it in a file directory (or export it there), pass the file location/path and then create and reference it or import it.
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

Re: transferring document

Post by crisg0112 »

RLJB wrote:Hey Chris, don't store it as a blob, put it in a file directory (or export it there), pass the file location/path and then create and reference it or import it.
Hi Rod,

I wish I could but this is more of a 'unsecure location' to a 'secure location' transfer. I cannot have any of the files sitting in the server at all.

Thanks for the idea though :) ...
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: transferring document

Post by customaware »

Do as Rod said ..... Import it and then delete it off the server
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
crisg0112
Posts: 395
Joined: Fri Jan 31, 2014 3:45 am
Location: Melbourne, Australia

Re: transferring document

Post by crisg0112 »

eagles9999 wrote:Do as Rod said ..... Import it and then delete it off the server
Mark,

let me explain the scenario :)

users will be accessing app_A, uploading the documents as needed, the physical files gets deleted after its been imported into its respective BO.

now App_B has a scheduled process (every 15 minutes) to read what's been entered into App_A.

App_B is accessing App_A database. App_A's table is defined as external database (objects) in App_B.

I agree that Rod's solution will work, but not in this case.
Thanks in advance!

Cris
MSSQL 2008R2, Aware 7 b2146, IE11, , Firefox 35.0.1, Windows 8 Bootstrap theme
Post Reply