public void saveUserLayout() throws PortalException{
if(isLayoutDirty()) {
Document ulm=this.getUserLayoutDOM();
if(ulm==null) {
throw new PortalException("UserLayout has not been initialized.");
} else {
if(this.getLayoutStore()==null) {
throw new PortalException("Store implementation has not been set.");
} else {
try {
this.getLayoutStore().setUserLayout(this.owner,this.profile,ulm,true);
// inform listeners
for(Iterator i=listeners.iterator();i.hasNext();) {
LayoutEventListener lel=(LayoutEventListener)i.next();
lel.layoutSaved();
}
} catch (PortalException pe) {
throw pe;
} catch (Exception e) {
throw new PortalException("Exception encountered while trying to save a layout for userId="+this.owner.getID()+", profileId="+this.profile.getProfileId(),e);
}
}
}
}
}