Poll

Programmatically, how can on retrieve a CMOD document and email that document?

This can be done.
5 (100%)
This cannot be done.
0 (0%)

Total Members Voted: 2

Author Topic: Retrieve a CMOD document and email found document  (Read 12336 times)

AllenFlynn

  • Guest
Retrieve a CMOD document and email found document
« on: December 15, 2011, 08:55:40 AM »
Hello All,

I'm new to the CMOD application and this forum. Happy to be here. :)
Quickly, I started on the Sys/34, been with the midrange system (amongst others) and here I am decades later with a new task to perform in regards to CMOD. Although I am quite familiar with walking around the iSeries, IFS, and lan server environments, I am quite ignorant of CMOD. I will soon have a client of my own. I have been asked to develop a web app for an authorised user to seek an invoice and email that invoice to an approved email address retained on file.

1) I have seen where a user can drill down to, select a customer invoice and email that invoice to a valid email address. Am I correct in this? Hope so... because...

2) Is it possible to do the above with a program that can supply all the parameters necessary to CMOD?

I have read and read and read documentation and am ?somehwhat? familiar with what is under the CMOD hood, so to say... I have scoured the web and have not found anything to provide pointers on how I am to accomplish this task. Nor have I found anything out there on the web to if this is even possible...

I will do the research necessary if anyone can provide some insight to this task.
Thank You Very Much.

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Retrieve a CMOD document and email found document
« Reply #1 on: December 16, 2011, 05:16:47 AM »
Hello Allen,

Apparently I'm the first to welcome you to the CMOD VIP Select User Group Club  ;D

So, I'm totally ignorant with Sys/34... I'm more a Unix/Windows guy with CMOD.
Nevertheless CMOD is quite the same between all the platform, at least from an application point of view.

So to do what you suggest, there are many possibilities. I will post some of them, that pops in my mind, and I'm sure other people might have other ideas on how to deal with your need.

1) Write a program/script to call the command "arsdoc" and use it to retrieve the document with the correct parameters:

eg:   arsdoc query -h CMODInstance -u user -p pwd -f Foldername -i "where date=15325 and customerno=1234"
(15325 = today date (16/12/2011) you can find out with the arsdate command)

With that command, you will be able to see if you have a document to retrieve

Then the retrieve is nearly the same command:

eg:   arsdoc get -h CMODInstance -u user -p pwd -f Foldername -i "where date=15325 and customerno=1234" -o outfilename

2) Write a program in Java, and use the CMOD Java interface (ODWEK), normally when you install it, you have a directory called "api", and there you should have 2 files: ODApi.jar and ODApiDoc.zip
If you look at this redbook, it would be a good starting point on how to use that interface : http://www.redbooks.ibm.com/abstracts/sg247646.html

I hope that helps to get started :-)

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #2 on: December 16, 2011, 06:38:17 AM »
Thank you for your reply Alessandro.

I will now dig into the posted red book. Learning is fun and I am looking forward to playing with this.

 ;D

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2229
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Retrieve a CMOD document and email found document
« Reply #3 on: December 16, 2011, 06:53:29 AM »
I know that you're using iSeries, but hopefully the process for sending an eMail from the server is similar to UNIX/Linux.

First, once you retrieve the file, it needs to be in a format that the customer can view it in.  For most companies, this is PDF.  You could also convert to GIF, JPEG, or BMP if those options are desirable.  Once in the PDF format, you'll need to convert it so that it can be sent in an eMail - normally using MIME base64 ( http://en.wikipedia.org/wiki/Base64 ).  After that, format your eMail ("Dear customer, here's your invoice.") and append the converted file.

It will take some trial and error, but it's entirely possible.

The only other thing to be aware of is that your mail server needs to be properly configured.  If I had a dime for every time an automated eMail is rejected from my server (because the remote server is misconfigured, and looks like a spammer) I'd be eating a steak dinner every night!

Good luck!

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

mpavel

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #4 on: December 29, 2011, 06:33:20 AM »
See the (my) post under the subject "Printing with Common Server".  I explain how we are doing what you want, been working great for a couple of years (been doing it a bit longer than that).

All written in RPGLE & CL, uses Data Queues, so you should be able to do it.  I came from System/3/34/38 backgound also.

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #5 on: January 04, 2012, 06:33:25 AM »
Thank you all for your help. The email portion is no problem. I have options in that we've been emailing "stuff" for years. My ignorance with CMOD is my issue.

I will be back to ask questions or provide information on what I've done.

Again, thank you all.!.!.! ;D

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #6 on: June 05, 2012, 01:30:58 PM »
Well, being in a small shop, I do have the luxery of dropping a project, doing other stuff, and picking things back up. I started this thread as a part wish list for our customer service people. I'm finally getting what AlessandroPerucchi has suggested. Learning on your own can be tough, but I have the documents out in an IFS folder of my choice.
Now... I'll be perusing http://www.redbooks.ibm.com/abstracts/sg247646.html to see what I now need to do and make a pdf.file and send it down the email express.!.!.!

We have had OnDemand for years. Customers call and want invoice reprints and that's a pain, they say... I've already written some web apps so customers and distributors can query their data for themselves and quit calling. Everyone seems happy, but... I hear if they can only retrieve their invoice from OnDemand... (I hear alot).   

I have secure signons for our web users and the invoice will be sent on;y to an authorized email address. When I pull this off, they'll just pee...

THANKS FOR ALL YOU HELP.!.!.!


Stephen McNulty

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Retrieve a CMOD document and email found document
« Reply #7 on: June 15, 2012, 05:30:38 AM »
Hi allen

one question, if your users are already using a secure signon and accessing their invoices.  Why not allow them to print them themselves?  Using ODWEK  (Ondemand Web Enablement Kit) the process to search and retrieve is fairly simple, leave the printing (or save) up to the customer through their web browser.
#ISERIES #ODWEK #XML

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #8 on: July 09, 2012, 05:38:32 AM »
[...]
one question, if your users are already using a secure signon and accessing their invoices.  Why not allow them to print them themselves?
[...]

Sorry for the late reply...
This application is for specific customers/distributors on the internet. A very limited and selected audience. Our web apps operate within a very controlled and private environment, outside of the system.

In a nutshell:
A user selects an invoice. That invoice is to be sent to the currently authorized email address. The requestor can then retrieve the invoice from the email address owner.

I have been able to utilize the arsdoc get command to create a file(document)(see below).
Now I must figure out how to convert this data file into a pdf document.
Then programmatically send that document via email.

Is the following correct so far?:

arsdoc get -v
-h "ServerName"
-u "User" -p "Password"
-f "OnDemandFolderName"
-i "where F_03 ='InvoiceNumber'"
-o "OutputFileName"
-d "MyIfsDirectory" -c                                         

Thank you all for the help :)

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #9 on: July 09, 2012, 05:56:30 AM »
BTW, I keep mentioning a pdf document to send via email. The image doesn't have to be a pdf. I don't care if it's a word document. As long as they receive a legible representaion of the invoice document.
 ::) ::) ::)

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #10 on: July 19, 2012, 07:32:54 AM »
I am learning much, but am having difficulty with connecting the dots.

I have an AFP stream file within an IFS folder. I can see the invoice document image with the AFP Workbench Viewer.
How can I, or where are there documents or examples, any direction is welcome:

How-To transform that IFS AFP streamfile into a PDF file within that same IFS folder?
Then I will be able to email that PDF file...

Thank You

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #11 on: July 26, 2012, 12:51:23 PM »
I was using this thread to document activity and display background for proceeding questions. Am I wrong, but are there missing entries in this thread?


Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2229
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Retrieve a CMOD document and email found document
« Reply #12 on: July 26, 2012, 09:06:36 PM »
I was using this thread to document activity and display background for proceeding questions. Am I wrong, but are there missing entries in this thread?

I'm not aware of any edits or deletes to this thread, and I didn't notice anything strange.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

AllenFlynn

  • Guest
Re: Retrieve a CMOD document and email found document
« Reply #13 on: July 27, 2012, 05:42:09 AM »
[...]
I'm not aware of any edits or deletes to this thread, and I didn't notice anything strange.

I apologize that I was indeed mistaken. I was using another online resource and there is where I found what I was looking for.
Again, I apologize for this error on my part.
I do appreciate all the help and replies that have been offered. Although OnDemand is not one of my "main" responsibilities, I have learned a great deal from this forum and consider this a valuable resource and very interesting.

edit: spelling always gets me without a spell-checker. Then again wrong words get through:

Ode to the Spell Checker

Eye halve a spelling chequer
It came with my pea sea
It plainly marques four my revue
Miss steaks eye kin knot sea.

Eye strike a key and type a word
And weight four it two say
Weather eye am wrong oar write
It shows me strait a weigh.

As soon as a mist ache is maid
It nose bee fore two long
And eye can put the error rite
Its rare lea ever wrong.

Eye have run this poem threw it
I am shore your pleased two no
Its letter perfect awl the weigh
My chequer tolled me sew.

(Sorry for getting off topic - Couldn't help myself  ;D
« Last Edit: July 27, 2012, 05:47:14 AM by AllenFlynn »

VAvandenBerg

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Retrieve a CMOD document and email found document
« Reply #14 on: October 29, 2012, 08:44:45 AM »
AllenFlynn,

Depending on the levels of the environment you could probably use CMIS and retrieve the document using a webservice.

VB