cars vs jsp - please explain what they do

I've tackled this issue before and gave up, but I would like to know what the purpose of the cars and the jsp files are. 

I'm trying to create a targeted content channel with 4 sections targeted to 4 different audiences.  In my channel, if there is nothing to show in section 2 and 3, I don't want the system to output anything.  REPEAT, anything.  However it does.  It inserts in an extra table row with an blank image.  I determined that the content from the channel was being formed in: /opt/luminis/webapps/luminis/jsp/content/p_channel.jsp.  The jsp output matched the browser's source code, and the logic made it look like it was building each section.

However, no changes made to that jsp file changed the structure of the channel.  I even deleted the file, restarted the system and compilejsp, and nothing.  No change.  The channel is still being built as always, with the extra space in for blank sections.

As I've dug into these before, I know that some code is hidden deep within the cars, so, I dig deep into the content.car and there is it, contentchannel.xsl, building the channel just as I thought the jsp did.  Edited the file, zipped it back up, and replaced the car.  Bounced the system, and it worked!  

Now, the real question is, what in the world does the jsp files do?  Each time an upgrade is made, the files are updated.  But the system doesn't look at the jsp files, only the car.  In other cases I have made updates to jsp files with the intended results.  Is it left over code from previous versions?  Or are they going to be used in the future instead of the cars?  Can someone please shed some light on this? 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I know in my experience w/

Edit: Whoops!  I just re-read your post, my reply wasn't even related to your question.  Sorry!.

JSP files in CAR files

Most of the time, if there is as JSP file in a CAR file, the CAR file implements a "JSP Model 2" channel.  For those channels, the JSP file is extracted to a location under $CP_HOME/webapps/luminis/WEB-INF/uPortal and then used to render the channel.  The JSPs are supposed to be extracted every time the CAR file is updated.  The extracted files are actually used in generating the channel content, so if they fail to extract you can run into issues (we have seen problems with directory permssions cause problems).

However, targeted content channels are something different.  Given that the jsp file you are talking about is not under WEB-INF says it is not extracted from a CAR file but is part of the  Luminis installation.   I see two reasons why your changes may not be showing up:  Either the JSP is not being recompiled after it is changed or the JSP is not the actual source of the targetted content channel output.

One way to be actually sure you the JSP gets recompiled is to delete the compiled version.  This can be found in the Tomcat work directory ($CP_WEB_ROOT/work).  The luminis webapp is the root context, so the directory under work is '_'.  This can be safely deleted as a whole, or you can traverse down inside it to find the actual .java and .class files for the particular JSP and delete them.

targeted content

This is one of the reasons why I decided to target content based on a tab rather than a channel.

So say you have a home tab, that you want targeted content on, that will differ between employees and students.  The way I do it, is to make 2 home tabs.  One for the student view, and one for the employee view.  Then using the layout manager, dictate who sees which tab.  

There is some redundancy obviously, but the greater control over the view is worth it to me.  It also allows easier changes when a particular role requests it.  If we decided to drastically alter what employees see on the home tab, we don't have to take into consideration how that will affect what students see. 

Not to mention that fine grained access control in targeted content channels has been resource intensive in the past.

 

targeted content

We do it just about the same way too, however we do have several channels on the home tab that are broken out into audiences.  All channels have a public section, but a few have additional audiences.

Syndicate content