CPIP using CALL and Java Classes
We use CALL quite a bit. We use it in the context of pickup.response because no-one want to let our lowly code onto their servers... fair enough (begone lowly portal varlet.... I'm reading medieval history at the moment, twas ever thus). So it was very nice to see that you can create a variable in your cpip xml file and use it in the pickup.response in your properties file. So you can have a variable hashValue in your xml as so:
<CALL a:class="uk.ac.hud.portals.sso.utils.GetHashValue">
<PARAM a:value="${_USERNAME}" />
<PARAM a:value="hashValue" />
</CALL>
... and then pick it up in the properties like so:
<input type="hidden" name="SSO" value="~{hashValue}" />
Which is very useful since we, like everyone else, are always discovering that we need more parameters than a simple username and password to get someone into a system at the right point.
And the Java class seems easy to do when you've done it a few times:
package uk.ac.hud.portals.sso.utils;
import com.campuspipeline.sso.authenticator.ExternalAuthenticationProcessor;
import com.campuspipeline.sso.authenticator.SymbolTable;
public class GetHashValue implements ExternalAuthenticationProcessor{
public void Process(SymbolTable context, String[] params) throws Exception{
String username = params[0];
String returnVal = params[1];
String result = getValue(username);
context.setValue(returnVal, result);
}
private String getValue(String username){
.....
}
}
Excellent. And we've rattled now through a fair few of these, doing various lookups of varied sorts. The only snag I ever have, and this is the most basic reason for this blog, is that I forget just how to put all the bits together in between times and end up trawling through my old code. This entry might at least help me cut out that bit of repetition!

Recent comments
10 hours 49 min ago
13 hours 57 min ago
16 hours 53 min ago
1 day 7 hours ago
2 days 8 hours ago
2 days 14 hours ago
3 days 12 hours ago
3 days 16 hours ago
4 days 7 hours ago
4 days 7 hours ago