}
public void saveUserProfiles() {
final String layoutKey = this.getDefaultLayoutKey();
ProfileLS adapter = null;
PortalService service = null;
try {
adapter = (ProfileLS) this.manager.lookup(ProfileLS.ROLE);
service = (PortalService) this.manager.lookup(PortalService.ROLE);
RequestState state = this.getRequestState();
UserHandler handler = state.getHandler();
HashMap parameters = new HashMap();
parameters.put("type", "user");
parameters.put("config", state.getApplicationConfiguration().getConfiguration("portal").getChild("profiles"));
parameters.put("handler", handler);
parameters.put("profiletype", "copletinstancedata");
Map key = this.buildKey(service, parameters, layoutKey, false);
// save coplet instance data
CopletInstanceDataManager profileManager = ((CopletInstanceDataManager)service.getAttribute("CopletInstanceData:" + layoutKey));
adapter.saveProfile(key, parameters, profileManager);
// save coplet instance data
parameters.put("profiletype", "layout");
key = this.buildKey(service, parameters, layoutKey, false);
Layout layout = (Layout)service.getAttribute("Layout:" + layoutKey);
adapter.saveProfile(key, parameters, layout);
} catch (Exception e) {
// TODO
throw new CascadingRuntimeException("Exception during save profile", e);