1 16 package org.apache.cocoon.portal.profile.impl; 17 18 import java.util.HashMap ; 19 import java.util.Iterator ; 20 import java.util.Map ; 21 22 import org.apache.cocoon.portal.layout.CompositeLayout; 23 import org.apache.cocoon.portal.layout.Item; 24 import org.apache.cocoon.portal.layout.Layout; 25 26 35 public class UserProfile { 36 37 protected Map copletBaseDatas; 38 39 protected Map copletDatas; 40 41 protected Map copletInstanceDatas; 42 43 protected Map layouts; 44 45 protected Layout rootLayout; 46 47 50 public Map getCopletBaseDatas() { 51 return copletBaseDatas; 52 } 53 54 57 public void setCopletBaseDatas(Map copletBaseDatas) { 58 this.copletBaseDatas = copletBaseDatas; 59 } 60 61 64 public Map getCopletDatas() { 65 return copletDatas; 66 } 67 68 71 public void setCopletDatas(Map copletDatas) { 72 this.copletDatas = copletDatas; 73 } 74 75 78 public Map getCopletInstanceDatas() { 79 return copletInstanceDatas; 80 } 81 82 85 public void setCopletInstanceDatas(Map copletInstanceDatas) { 86 this.copletInstanceDatas = copletInstanceDatas; 87 } 88 89 92 public Map getLayouts() { 93 return layouts; 94 } 95 96 99 public Layout getRootLayout() { 100 return rootLayout; 101 } 102 103 106 public void setRootLayout(Layout rootLayout) { 107 this.rootLayout = rootLayout; 108 this.layouts = new HashMap (); 109 this.cacheLayouts(this.layouts, rootLayout); 110 } 111 112 protected void cacheLayouts(Map layoutMap, Layout layout) { 113 if ( layout != null ) { 114 if ( layout.getId() != null ) { 115 layoutMap.put( layout.getId(), layout ); 116 } 117 if ( layout instanceof CompositeLayout ) { 118 final CompositeLayout cl = (CompositeLayout)layout; 119 final Iterator i = cl.getItems().iterator(); 120 while ( i.hasNext() ) { 121 final Item current = (Item)i.next(); 122 this.cacheLayouts( layoutMap, current.getLayout() ); 123 } 124 } 125 } 126 } 127 128 } 129 | Popular Tags |