// TODO - make this configurable
final String requestParameterName = "frame";
final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
String[] values = request.getParameterValues(requestParameterName);
if (values != null) {
final Publisher publisher = context.getEventPublisher();
for (int i = 0; i < values.length; i++) {
final String value = values[i];
Event e = null;
try {
e = context.getEventConverter().decode(value);
if (null != e) {
publisher.publish(e);
}
} catch (Exception ignore) {
}
if (e == null) {
// Use '|' character as delimiter between ID and URI
int index = value.indexOf('|');
if (index != -1) {
String id = value.substring(0, index);
String uri = null;
if (index != (value.length() - 1)) {
uri = value.substring(index + 1);
}
ProfileManager profileManager = null;
try {
profileManager = (ProfileManager)this.manager.lookup(ProfileManager.ROLE);
Layout layout = profileManager.getPortalLayout( id );
if ( layout != null ) {
e = new ChangeAspectDataEvent(layout, "frame", uri);
publisher.publish(e);
}
} catch (ComponentException ignore) {
} finally {
this.manager.release( profileManager );
}