Classified Ads Channel in Luminis 4
Here is the U of S Classified Ads channel for use with Luminis 4. Again, we use the Luminis Oracle database to hold our database objects (tables, sequence) so if you want to use a separate database for classifieds you would need to modify the code.
There are a few parameters that you need to supply when creating the channel. I've taken a screenshot of those parameters. Some of them need explaining:
admin.daystodeleteads: how many days an ad will remain in the database before it is deleted. Note that when ads expire, users no longer see them, but they are still in the database. This is for administrators, so we can look up ads in case we need to refer back to them. Also used for stats gathering.
admin.email: the email address to use when sending reports of users who complain about inappropriate ads
admin.expireserver: if you are on single server, then put the server name. If you are on PD, pick only one of your web servers and put that here. This will be the server responsible for checking for expired ads to take them down.
admin.maxnumbervoted: how many people need to flag an ad as inappropriate before the system automatically takes it down. We keep it at 10 to prevent false alarms if only one person reports it as inappropripate.
date.format: you should not need to change this from what we have supplied, but if your database can't work with the format given, then change the mask.
Sorry, we don't package this as a CAR file, since we modifed the database schema to include a sequence, and the CAR can't create that it can only do tables (to the best of my knowledge). If I'm wrong on that, I'm sure Bill from U of M will correct me! :)
You will want to review the Terms of Service (in two xsl files), and replace them with your own. I've included ours to give you something to work from. Our lawyers may have gone a bit overboard in trying to protect us, but the good thing is that we have a community-monitored system, we barely ever need to get involved with policing this channel. There is a facility to ban a user from using the channel (add them to the CLASSIFIEDS_USER_BANNED table) but no GUI for this, I just add them manually. About 3 students per year.
Todd

Jar file?
To deploy this channel, did you create a jar file (with the same directory structure) in $CP_WEBINF/lib?
Deploy Classes
No, we didn't use a jar. We copied the whole "edu" tree, and placed it in $CP_WEBINF/classes and restart Luminis before creating the channel.
Todd
BrowserInfo
And our developer tells me you also need to place BrowserInfo.class into
$CP_WEBINF/classes/org/jasig/portal/
Having a little trouble with the Database privileges
First of all, thank you Todd for sharing the Classified Ads channel with everyone.
We are on Luminis 4.2.1 with Oracle DB backend. I am attempting to implement the Classified Ads Channel into Luminis at our school. I can get the channel to render in the Luminis GUI and it starts with the Terms of Service view, which all seems to be as expected.
The issue seems to be with the database. The tables were all created in the Luminis database where our other Luminis objects are and these new Classified Ads tables all have the same owner and tablespace name as the other Luminis objects, for example:
OWNER LUMINIS
TABLE_NAME CLASSIFIEDS_USER_AGREE
TABLESPACE_NAME LUMINIS
but getting this error in cp.log when I click the "Agree " button (for Terms of Service) in the GUI.
[2010-02-07 14:44:31,847] [ERROR](?:?) {pool-3-thread-32--[n92 Classified Ads]} [edu.iastate.ait.channels.classifieds.ClassifiedsUserAgree]: ClassifiedsUserAgree:AddINSERT INTO CLASSIFIEDS_USER_AGREE (USER_ID,AGREE_DATE) VALUES (21,SYSDATE )
[2010-02-07 14:44:31,848] [ERROR](?:?) {pool-3-thread-32--[n92 Classified Ads]} [edu.iastate.ait.channels.classifieds.ClassifiedsUserAgree]: java.sql.SQLException: ORA-00942: table or view does not exist
java.sql.SQLException: ORA-00942: table or view does not exist
I have looked at it from all the angles I can think of. We run both Luminis and the DB on Linux servers. This seems like a dumb question to me, but is there any possibility that case-sensitivity is a factor here? Can anybody help point me in the right direction? Thanks in advance.
DB log
Case sensitivity should not be the problem if your tables are all in upper case, and you see the SQL is in upper case. Although it's possible to create mixed-case tables in Oracle, I think the default is upper case.
What do your database logs have in them? Perhaps the error in those logs will be of more help than the cp.log file.
Todd
database logs
I checked in the log called alert_lumdev.log (where LUMDEV is our luminis db for our Luminis DEV environment) and there are no errors in that log.
Just to confirm, the application user (Classified Ads) trying to contact the database is LUMINIS, just like all the baseline Lumins channels right?
Thanks.
Carla
Direct access
Should be, yes. Why don't you just use a database tool like SQL Plus and log into the schema account directly and run the SQL? Perhaps you can reproduce this error.
Todd
Solution Found for Connection Issue, but still a little issue
I built a small java connector class and was able to make it use the LUMINIS user to connect to the DB server from the luminis app server and do inserts into the Classified Ads table: CLASSIFIEDS_USER_AGREE without producing an error.
Next, I reviewed in all the database configuration settings (configman -g) and realized that we have database settings for the user UPORTAL in our Luminis installation.
So I went back to the database and granted the user UPORTAL rights to all the Classified Ads objects that are owned by LUMINIS. We also made public synonyms for these objects.
Voila! the channel has now renders beyond the "Terms of Agreement" piece.
Now, however, we now get a runtime error at
java.lang.NullPointerException at edu.iastate.ait.channels.classifieds.Ad.addAd(Ad.java:238)
.... so have to work on that next.
It is working!
The final piece was that I also needed to get the Classified Ads channel working properly was to grant SELECT to the user UPORTAL to the sequence object: LUMINIS.CLASSIFIEDS_ADS_SEQ.
So this leaves me with the burning question: Why our Luminis 4.2.1.x installation is compelled to use UPORTAL as the application user to make the DB connection for the Classified Ads channel, when all the other channel objects are connected with the LUMINIS user? I checked and none of the other baseline DB objects (Group Tools and such) that are owned by LUMINIS have a grant to UPORTAL.
Does anyone have an idea on the possibility that we have some mysterious configuration in our implementation that would be causing this behaviour?
Thanks.
Carla
Configman
When I do this:
configman -g uportal.database.user.id
For us, this returns the LUMINIS user id, not anything different. That is, it matches exactly with:
configman -g database.datasource.oracle1.user
(this may not be the correct configman name to check at your school, you might have to first check "database.GroupTools.datasource" value to see what data source name to look for)
Todd
uportal.database.user.id
You have identified it for me, here is our output:
]$ configman -g uportal.database.user.id
uportal
]$ configman -g database.datasource.oracle1.user
luminis
So now I will experiment with setting the uportal.database.user.id = luminis, and removing all the grants to UPORTAL on the database objects for Classified Ads.
Thank you very much Todd for all your help on this!