String media,
String contextID)
throws IOException, SAXException, ProcessingException {
// synchronized not req.
this.setup();
Response response = ContextHelper.getResponse(this.componentContext);
XMLUtils.startElement(consumer, PortalConstants.ELEMENT_CONFIGURATION);
// set the portal-page uri:
StringBuffer buffer = new StringBuffer(requestURI);
buffer.append((requestURI.indexOf('?') == -1 ? '?' : '&'))
.append(PortalManagerImpl.REQ_PARAMETER_PROFILE)
.append('=')
.append(profileID);
String uri = response.encodeURL(buffer.toString());
XMLUtils.startElement(consumer, "uri");
XMLUtils.data(consumer, uri);
XMLUtils.endElement(consumer, "uri");
Map config = this.getConfiguration();
String portalURI = response.encodeURL((String)config.get(PortalConstants.CONF_PORTAL_URI));
XMLUtils.startElement(consumer, "portal");
XMLUtils.data(consumer, portalURI);
XMLUtils.endElement(consumer, "portal");