University Web Developers

University Web Developers

This website is a great resource.

I've been coding php for a few weeks now and recently was able to start using UniObjects so that I can now code directly from/to our Datatel/UniData ERP. Our web design group is thinking up a new student portal, and it will be great to be able to provide widget services that can talk to the Administrative systems...

I'd love to hear from all y'all who are doing, need to do, or want to do the same sort of thing in a UniData world...

Views: 1208

Replies to This Discussion

Groovy Jeff. Anything I can do to help yas get up and running, fire away!

R

rharrington@sxu.edu
talk about good timing.
I'm on the hunt for PHP + UniData for my work situation also, and low and behold, I find this ning group and this thread.

I'll be starting on this project hard core next week :)

We're a colleague school, and I have answernet access, so this should hopefully be pretty easy.
Great Duran! I just finished a relatively simple project. It's php & uniobjects but it's currently a utility (run by me) rather than an application (run by users), so there's no real web interface just an output display. It's a great example though because it uses both the query access method of the UniSession Command object and the file read/write methods UniDynArray object. I'm posting the files here for anyone interested.

The purpose of this job is to take an essay entered into a third party web application as part of an online academic application , and insert the contents into the APPLICANTS APP.COMMENTS more or less free form text field.

- The incoming record is tab delimited
- The first column of every incoming record is a unique identifier from the 3rd party consultant that may or may not have already been punched into PERSON PERSON.ALT.IDS. Records that had been manually entered are missing this field.
- The second column of the incoming file is our PERSON ID (missing leading zeroes) if the original source was our student system - those not from our system are blank.
- The Third and Fourth columns are the Last and First Names of the student
- The fifth column is the essay type indicator. All of these are type 'ESS'
- the sixth column is the essay body, up to 7000 characters where the CR/LF's (linefeeds) have been replaced by pipes '|'. This allows us to reconstititute the original formatting as the student entered it.

So the main logic of the job is this:

- Open the incoming file (via FTP) and establish a Colleague connection
- Try to locate the APPLICANTS id:
1) read PERSON.ALT.IDS with the Consultant's Unique Identifier
2) If no match then if Column 2 has the Person ID in it, format that properly
3) If no match then locate the most recently entered record with the Student's Last/First Name
4) throw an error if we still don't have a valid PERSON ID

- Open the APPLICANTS file using the PERSON ID else throw an error.
- Break up the incoming text file by paragraphs (explode on the pipe character)
- Break up the paragraphs into words (explode paragraph on spaces)
- fabricate the output line word by word. If the next word pushes the line length over 60 (the limit for ASUM=>Comments UTEC), append the value mark.
- Loop until all essay paragraphs have been reformatted for ASUM

- Update the APP.COMMENTS field

- Loop until all records processed.

I'm posting the main code and the UniObjects wrapper I developed to make it easier to post simple queries, plus a sample of data. Note that the line that actually does the WRITE is commented out as a safety measure.

Good luck with your project and let me know if you come up with anything cool!
Attachments:
This resource has practically changed my life. I cannot express in words how much I've been able to do using UniObjects. And I'd never heard of it before!

One quick example:

At our institution, we use Moodle (written in PHP, and open source), as our online learning system. Getting the classes to be created automatically when they are created in Colleague, and getting them to be automatically populated with students, was a long process. We use a combination of Informer reports (which write to files), MSSQL DTS packages (to import the data into an SQL database), and a third-party Moodle module (to read the SQL database and create the classes) to get everything created in Moodle.

Problems arose when teachers were accidentally having their sections created with incorrect characters in the section names, etc--any change to Colleague would trigger another course being created in Moodle. We migrated to using the COURSE.SECTIONS.ID instead of the term, subject, course number, and section number combination to prevent this problem.

Using PHP and UniObjects, we've been able to connect functionality in Moodle directly to data in Colleague, allowing us to query Colleague based on data in Moodle right from the Moodle interface.

We've had a lot of success with the various tools and toys available to us, and UniObjects via PHP (and other languages!) is yet another great tool to add to the box!
Same here Brandon. Now anytime I have a tough nut to crack I almost always reach for this.

I used to us Access/VBA for things like this last application, but the depth of the string functions in php makes even a complex mapping like this one pretty much a snap.

Good luck. post cool code if you gots it...

R
hi,
i just discovered this website and thread and i'm new to php.
my question is how to do you install/use the uniobjectDK into php?
i tried copying the uniobjects.dll into the php extensions directory.
then i configured the php.ini file (extension=uniobjects.dll).
but when i call up the php.info(), uniobjects doesn't show.
any advice on setting up uniobjects with php?

thanks
Hi Henry,

UniObjects is exposed via a COM object, and you use PHP's COM functionality (http://php.net/com):

$ud_session = new COM("Uniobjects.Unioaifctrl");

You can see the constants, objects, and methods defined in the help file included with the UniDK installation. If I am not mistaken (I cannot check as I am running Windows 7, which has no .hlp support at the moment) it is installed in C:\IBM\UniDK\help\Uobjs.hlp (assuming a default install directory of C:\IBM\UniDK).
The windows flavor of UniObjects is a Windows COM object library rather than a php extension. The java flavor is invoked differently but I'm not familiar enough working with it to give directions on using it.

UniObjects for windows is installed using the standard UniDK library installer (the 'IBM UniData Setup Launchpad' utility). Once registered by the installer you can instantiate it with a call to create a new COM object of type "Uniobjects.Unioaifctrl" - the Unidata Command & Session object:

$us = new COM("Uniobjects.Unioaifctrl");

Once instantiated, you can set the properties and invoke the methods as described int he IBM UniObjects

$us->Transport = 1;
$us->DatabaseType = 2;
$us->HostName = "my.datatel.host";
$us->AccountPath = "/datatel/coll18/production/apphome/";
$us->UserName = myUsername;
$us->Password = myPassword;
$us->Connect;

once connected you can send commands and return data (open a file sample):

$fm = $us->FM();

$fn = "PERSON";
$uf = $us->OpenFile($fn);
$uf->RecordId = $myPersonID;
$uf->Record = $myPersonRecord;
// $uf->Record = implode($fm,$rs);
$uf->Write();

$uf->CloseFile;
$uf = null;
$us->Disconnect();
$us = null;
$ud = null;

(execute a query sample:)

$sq = 'LIST PERSON WITH (ID <> "0000001") EVAL"ID:\'|\':LAST.NAME:\'|\':FIRST.NAME:\'|\':MIDDLE.NAME:\'|\':PREFIX:\'|\':SUFFIX:\'|\':OCONV(SPOUSE,\'TPERSON;X;;3\'):\'|\':CONVERT(@VM,\' \',OCONV(PREFERRED.ADDRESS,\'TADDRESS;X;;5\')):\'|\':OCONV(PREFERRED.ADDRESS,\'TADDRESS;X;;3\'):\'|\':OCONV(PREFERRED.ADDRESS,\'TADDRESS;X;;2\'):\'|\':OCONV(PREFERRED.ADDRESS,\'TADDRESS;X;;1\'):\'|\':SSN:\'|\':OCONV(BIRTH.DATE,\'D4-YMD\'):\'|\':GENDER:\'|\':OCONV(ETHNIC,\'TETHNICS;X;;1\'):\'|\':FIELD(PERSON.EMAIL.ADDRESSES,@VM,1,1):\'|\':FIELD(OCONV(ID,\'TFACULTY;X;;43\'),@VM,1,1):\'|\':FIELD(OCONV(ID,\'TFACULTY;X;;44\'),@VM,1,1):\'~\'" FMT "300L" ID.SUP HDR.SUP COL.SUP COUNT.SUP NO.PAGE';

$us->Command->Text = $sq;
$us->Command->Exec;
$this->udResult = $us->Command->Response;
break;


The other COM object installed by the setup utility is the Unidata Dynamic Array control ("Uniobjects.UniDynArray") that allows you to manipulate the UniData datasets using object references.
Hey Brandon - 'sup. Beat me this time.
Hi Rich,

Your answer was much more detailed (and likely helpful!) :)

Your initial code post from "way-back-when" was very helpful. I've taken the class and expanded it a bit and black-boxed it a lot for use by programmers not super-familiar with Datatel's information structure. I'll post some code some time after I clean it up. :) Eventually, I'd like to be able to do something more like http://binarymuse.pastebin.com/f3a5d1277 so that the entire Datatel experience is hidden away from the user (similar to Informer, but for programmers).


Since it was mentioned, for those interested, the Java API for UniObjects is contained in the packages asjava.uniclientlibs and asjava.uniobjects, from the file asjava.zip. (There is also a package asjava.unirpc, but I haven't messed with it at all).

// Excerpts of relevant code:

// CONNECTING
try
{
this.session = new UniSession();
this.session.setUserName(this.username);
this.session.setPassword(this.password);
this.session.setHostName(this.server);
this.session.setAccountPath(this.path);
this.session.setDataSourceType(this.db_type);

this.session.connect();
}
catch(UniConnectionException e)
{
System.out.println("Exception: " + e.getMessage());
}
catch(UniSessionException e)
{
System.out.println("Exception: " + e.getMessage());
}

if(this.session.isActive())
{
System.out.println("UniData session is open.");
}
else
{
System.out.println("UniData session is NOT open.");
}

// READING A FILE
UniFile file_person = null;
try
{
file_person = this.session.open("PERSON");
file_person.setRecordID("0123456");
Object[] fields = {
"ID", "FIRST.NAME", "LAST.NAME", "X.PER.BST.EMAIL"
};
for(int i = 0; i < fields.length; i++)
{
System.out.println(fields[i] + " is " + file_person.readNamedField(fields[i]));
}
// close the file we opened
file_person.close();
}
catch(UniSessionException e)
{
System.out.println("Exception: " + e.getMessage());
}
catch(UniFileException e)
{
System.out.println("Exception: " + e.getMessage());
}
brandon, rich
thank you for the replies!
i'll take a look at the COM object and let you know how it goes.
thanks again for your help.
I have created a new reworked uniObjects class based on Richard's class and uploaded it to Google Code. I have added functionality that seems to handle multi-value fields a little better, and I will be adding additional methods for writing to the database soon.

Link to Google Code SVN Repo (example query file included):
uniObjects on Google Code

Maybe we can all contribute to this and get a unified resource for interacting with Colleague? Let me know what you think.

RSS

Elsewhere

Latest Activity

Profile IconBilly McDonald and Meg Thomas joined University Web Developers
yesterday
Daniel Bashaw replied to Kimbel Jeffers's discussion Office Reservation software
"Hi Kimbel -- Does you manual process include a checklist and workflow documentation? If not, it sounds to me like checklists and schedulers are your best next steps. You can structure and document what you do now, and then look at it to see if there…"
Friday
Kimbel Jeffers replied to Kimbel Jeffers's discussion Office Reservation software
"The problem is we use a manual process right now and things keep falling through the cracks."
Thursday
Annette Spearman replied to Derek Tonn's discussion Freelance web design recommendations (small projects)
"Hi Derek, We can help you! I'll in box you all my info so we can connect and set up some time to talk. Annette "
Thursday
Mark Rothbaum posted a discussion

5-Minute Survey on Use of Facebook in Admissions

We're conducting our annual survey on Facebook and Admissions. Please take a few minutes to complete the survey at:http://www.varsityoutreach.com/FacebookSurvey/Our GoalOur goal is to explore trends related to how schools are using Facebook to reach out to prospective and admitted students.How Is the Data Used?All data will be shown in the aggregate. Answers from individual schools will not be released and will remain…See More
Thursday
Profile IconSang Yoon and Brittany Smith joined University Web Developers
May 15
Colleen Brennan-Barry posted a discussion

HighEdWeb Welcomes Steve Wozniak & Scott Stratten

HighEdWeb is very pleased to announce HighEdWeb 2013 Annual Conference opening keynote speaker Steve Wozniak and closing keynote speaker…See More
May 15
faris ahmed commented on social networking web design's blog post Megastar Media Webby Award Honorees
"wow thats amazing article .  your stuff never fails to amaze me honestly . great work as always :D  something i would like to add in is that  the entries each year are rapidly increasing .  but i think thats cause they take the…"
May 14
Lynn Zawie posted a discussion

Freelance Web Developer Needed

Stony Brook University web team is looking for some help coding a new design.  HTML5, CSS3, JQuery, Responsive Design expertise needed.  If you are interested in bidding on this project, I am happy to share more details.  Work would need to begin early summer.  ..LynnSee More
May 14
Sara Michel commented on Lynn Zawie's group OmniUpdate
"Great blog post by Higher Education Marketing on leveraging Google pay-per-click ad extensions for higher ed."
May 14
Sara Michel commented on Lynn Zawie's group OmniUpdate
"Check out Naropa University's new online magazine. Looks awesome! Great job team."
May 13
Norma J Dowell replied to Derek Tonn's discussion Freelance web design recommendations (small projects)
"Hi Derek! First of all, apologies for taking so long to respond! Secondly, I am not your web developer for such an issue, but if you can find someone to pick their brain and use as a sounding board, it may be all you need.  In the past, when I…"
May 13
Daniel Bashaw replied to Kimbel Jeffers's discussion Office Reservation software
"Hi Kimbel. I know you've been tasked with finding a software solution, though I'm wondering if you may need an interim step first: Does your institution have checklists covering all of the steps needed in on-boarding, relocating, and…"
May 13
Kimbel Jeffers posted a discussion

Office Reservation software

I've been tasked with finding a software tool that helps manage the onboarding and exit process of new and departing faculty. Ultimately i would like this software to management faculty office interms of when resources can be removed from a particular office and when a new faculty member can be moved in with the necessary resources. This tool should have notifications and alerts so there are no conflicts with someone being removed from a office and someone being placed in a office. Does anyone…See More
May 11
Sara Michel commented on Lynn Zawie's group OmniUpdate
"Congrats to Harper College on going live with their new online course catalog! Looks great!"
May 10
Helen Mosher joined Aaron Rester's group
May 9
Helen Mosher joined Mark Greenfield's group
May 9
Helen Mosher posted a status
"After 8 years being away from higher-ed communications work, I'm very interested in returning."
May 9
Will Martin is now a member of University Web Developers
May 6
Sarah McMaster replied to Katra Farah's discussion Online chat interfaces
"Thanks, Daniel. We don't currently have any livechat solution so this is new fact-finding territory for us! I will keep the forum posted as/if we are able to move forward."
May 3

UWEBD has been in existence for more than 10 years and is the very best email discussion list on the Internet, in any industry, on any topic

About

© 2013   Created by Mark Greenfield.

Badges  |  Report an Issue  |  Terms of Service