if (name.equals(Constants.SESSION_CONTEXT_NAME) == true) {
Request req = ObjectModelHelper.getRequest(objectModel);
Session session = req.getSession(false);
if (session != null) {
SunSpot sunSpot = null;
try {
sunSpot = (SunSpot)manager.lookup(SunSpot.ROLE);
// is this an external resource which wants access to a sunlet?
String value = req.getParameter("sunspotcontext");
if (value != null) {
int sepOne, sepTwo;
sepOne = value.indexOf('_');
if (sepOne != -1) {
sepTwo = value.indexOf('_', sepOne+1);
if (sepTwo != -1) {
String sunletIdentifier = value.substring(0, sepOne);
String sunletID = value.substring(sepOne+1, sepTwo);
String sunletNumber = value.substring(sepTwo+1);
if (sunletIdentifier.equals("sunlet") == true) {
Map info = new HashMap(3);
SessionContextImpl.sunLetInfo.set(info);
SourceParameters pars = new SourceParameters();
info.put(Constants.SUNLETINFO_PARAMETERS, pars);
pars.setSingleParameterValue(Constants.PARAMETER_ID, sunletID);
pars.setSingleParameterValue(Constants.PARAMETER_NUMBER, sunletNumber);
pars.setSingleParameterValue(Constants.PARAMETER_MEDIA,
(String)req.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_MEDIA_TYPE));
info.put(Constants.SUNLETINFO_STATUSPROFILE, sunSpot.getStatusProfile());
info.put(Constants.SUNLETINFO_PORTALURI, req.getRequestURI());
}
}
}
} else {