added sidebox view, prep for sysadmin menu stuff
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
*
|
||||
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
* Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
* Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
@@ -27,6 +27,7 @@ import com.silverwrist.dynamo.RequestType;
|
||||
import com.silverwrist.dynamo.event.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.security.SecurityReferenceMonitor;
|
||||
import com.silverwrist.dynamo.util.*;
|
||||
import com.silverwrist.dynamo.velocity.VelocityParamSupplier;
|
||||
import com.silverwrist.dynamo.velocity.VelocityRendererConfig;
|
||||
@@ -114,8 +115,6 @@ public class FrameAssembler
|
||||
|
||||
private static final Pattern PAT_LINEBREAK = Pattern.compile("\\r*\\n");
|
||||
|
||||
private static final int[] NO_ACLS = new int[0];
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
@@ -124,6 +123,7 @@ public class FrameAssembler
|
||||
private String m_name; // this object's name
|
||||
private ObjectProvider m_props; // global properties
|
||||
private ObjectProvider m_blocks; // global blocks
|
||||
private SecurityReferenceMonitor m_srm; // security reference monitor
|
||||
private MenuProvider m_menu_prov; // menu provider
|
||||
private String m_frame_template; // frame template parameter
|
||||
private HashMap m_globals = new HashMap(); // globals fed to Velocity
|
||||
@@ -227,7 +227,7 @@ public class FrameAssembler
|
||||
logger.info("FrameAssembler initializing");
|
||||
|
||||
XMLLoader loader = XMLLoader.get();
|
||||
String gprops = null, name_menu = null;
|
||||
String gprops = null, name_srm = null, name_menu = null;
|
||||
try
|
||||
{ // verify the right node name
|
||||
loader.verifyNodeName(config_root,"object");
|
||||
@@ -242,6 +242,7 @@ public class FrameAssembler
|
||||
|
||||
// get the name of the menu manager
|
||||
foo = loader.getSubElement(config_root_h,"providers");
|
||||
name_srm = loader.getAttribute(foo,"security");
|
||||
name_menu = loader.getAttribute(foo,"menu");
|
||||
|
||||
} // end try
|
||||
@@ -285,6 +286,10 @@ public class FrameAssembler
|
||||
|
||||
m_base_params = new BaseParams(); // create base parameter object
|
||||
|
||||
// Get the security reference monitor.
|
||||
m_srm =
|
||||
(SecurityReferenceMonitor)(GetObjectUtils.getDynamoComponent(services,SecurityReferenceMonitor.class,
|
||||
name_srm));
|
||||
// Load the menu provider.
|
||||
m_menu_prov = (MenuProvider)(GetObjectUtils.getDynamoComponent(services,MenuProvider.class,name_menu));
|
||||
|
||||
@@ -350,9 +355,11 @@ public class FrameAssembler
|
||||
Boolean display_login = (Boolean)(r.getObject(SessionInfoParams.REQ_NAMESPACE,
|
||||
SessionInfoParams.RATTR_DISPLAY_LOGIN));
|
||||
|
||||
// get the menus
|
||||
// get the fixed menu
|
||||
int[] acls = new int[1];
|
||||
acls[0] = m_srm.getGlobalAcl().getAclID();
|
||||
MenuRenderObject fixed_menu = m_menu_prov.getLeftMenu(user,VeniceNamespaces.FRAME_LAF_NAMESPACE,
|
||||
"fixed.menu",NO_ACLS);
|
||||
"fixed.menu",acls);
|
||||
|
||||
// get the footer and optionally insert line breaks
|
||||
String footer = (String)(m_blocks.getObject(NAMESPACE,BLOCK_FOOTER));
|
||||
@@ -433,6 +440,8 @@ public class FrameAssembler
|
||||
tmp2.put(PARAM_FAVICON_URL,String.class);
|
||||
tmp.put(PARAM_FAVICON_URL_TYPE,"favicon_ltyp");
|
||||
tmp2.put(PARAM_FAVICON_URL_TYPE,String.class);
|
||||
tmp.put(PARAM_LEFT_BAR_WIDTH,"lbar_width");
|
||||
tmp2.put(PARAM_LEFT_BAR_WIDTH,Integer.class);
|
||||
PROP_TO_VELOCITY = Collections.unmodifiableMap(tmp);
|
||||
PROP_TO_TYPE = Collections.unmodifiableMap(tmp2);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
* Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
* Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
@@ -51,6 +51,8 @@ public interface FrameParameters
|
||||
|
||||
public static final String PARAM_FAVICON_URL_TYPE = "page.favicon.url.type";
|
||||
|
||||
public static final String PARAM_LEFT_BAR_WIDTH = "left.bar.width";
|
||||
|
||||
public static final String BLOCK_FOOTER = "footer";
|
||||
|
||||
public static final int OPT_COMMENTS = 0;
|
||||
|
||||
Reference in New Issue
Block a user