You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2006/06/07 22:55:15 UTC

svn commit: r412538 - in /portals/jetspeed-2/trunk/applications/j2-admin/src: java/org/apache/jetspeed/portlets/security/permissions/ webapp/WEB-INF/ webapp/WEB-INF/security/permissions/ webapp/WEB-INF/view/customizer/

Author: taylor
Date: Wed Jun  7 13:55:14 2006
New Revision: 412538

URL: http://svn.apache.org/viewvc?rev=412538&view=rev
Log:
basic functionality for dojo/velocity portlets

Added:
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
Modified:
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/jetspeed-portlet.xml
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/customizer/customizer.vm

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java?rev=412538&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java Wed Jun  7 13:55:14 2006
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.security.permissions;
+
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.security.PermissionManager;
+import org.apache.portals.gems.dojo.AbstractDojoVelocityPortlet;
+import org.apache.velocity.context.Context;
+
+/**
+ * Security Permissions Portlet
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class SecurityPermissionsPortlet extends AbstractDojoVelocityPortlet
+{
+    protected final Log logger = LogFactory.getLog(this.getClass());
+    protected PermissionManager pm = null;
+    
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        PortletContext context = getPortletContext();
+        pm = (PermissionManager) context
+                .getAttribute(CommonPortletServices.CPS_PERMISSION_MANAGER);
+        if (pm == null)
+                throw new PortletException(
+                        "Could not get instance of portal permission manager component");
+    }
+
+    protected void includeDojoRequires(StringBuffer headerInfoText)
+    {
+        appendHeaderText(headerInfoText, "dojo.lang.*");
+        appendHeaderText(headerInfoText, "dojo.event.*");
+        appendHeaderText(headerInfoText, "dojo.io");
+        appendHeaderText(headerInfoText, "dojo.widget.LayoutContainer");
+        appendHeaderText(headerInfoText, "dojo.widget.ContentPane");
+        appendHeaderText(headerInfoText, "dojo.widget.LinkPane");
+        appendHeaderText(headerInfoText, "dojo.widget.SplitContainer");
+        appendHeaderText(headerInfoText, "dojo.widget.TabContainer");
+        appendHeaderText(headerInfoText, "dojo.widget.Tree");
+    }
+    
+    public void doView(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {
+        Context velocityContext = getContext(request);
+        PortletSession session = request.getPortletSession();
+        List permissions = new LinkedList();
+        permissions.add("one");
+        permissions.add("two");
+        permissions.add("three");
+        permissions.add("four");
+        permissions.add("five");
+        permissions.add("six");        
+        velocityContext.put("permissions", permissions);
+        super.doView(request, response);
+    }
+
+    public void processAction(ActionRequest request,
+            ActionResponse actionResponse) throws PortletException, IOException
+    {
+        PortletSession session = request.getPortletSession();
+        //session.setAttribute(SESSION_RESULTS, stats);
+    }
+
+}

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/jetspeed-portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/jetspeed-portlet.xml?rev=412538&r1=412537&r2=412538&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/jetspeed-portlet.xml (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/jetspeed-portlet.xml Wed Jun  7 13:55:14 2006
@@ -51,7 +51,8 @@
         <js:service name='RoleManager'/>
 	    <js:service name='SearchComponent'/>                
         <js:service name="SSO" />                 
-        <js:service name='UserManager'/>        
+        <js:service name='UserManager'/>     
+        <js:service name='HeaderResource'/>   
 	</js:services>
 
 </portlet-app>

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml?rev=412538&r1=412537&r2=412538&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml Wed Jun  7 13:55:14 2006
@@ -1181,6 +1181,26 @@
             <short-title>Login</short-title>
         </portlet-info>
     </portlet>
+    <portlet id="SecurityPermissionsPortlet">
+        <init-param>
+            <name>ViewPage</name>
+            <value>/WEB-INF/security/permissions/view.vm</value>
+        </init-param>
+        <portlet-name>SecurityPermissionsPortlet</portlet-name>
+        <display-name>Security Permissions</display-name>
+        <portlet-class>org.apache.jetspeed.portlets.security.permissions.SecurityPermissionsPortlet</portlet-class>
+        <expiration-cache>-1</expiration-cache>
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+            <portlet-mode>EDIT</portlet-mode>            
+        </supports>
+        <supported-locale>en</supported-locale>
+        <portlet-info>
+            <title>Security Permissions</title>
+            <short-title>Permissions</short-title>
+        </portlet-info>
+    </portlet>
      
 </portlet-app>
 

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm?rev=412538&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm Wed Jun  7 13:55:14 2006
@@ -0,0 +1,48 @@
+<div dojoType="LayoutContainer"
+    layoutChildPriority='top-bottom'
+    style="width: 100%; height: 100%;">
+    <div dojoType="SplitContainer"
+        orientation="horizontal"
+        sizerWidth="5"
+        activeSizing="0"
+        layoutAlign="client"
+    >
+        <div dojoType="Tree" publishSelectionTopic="treeSelected" toggle="fade"
+             sizeMin="20" sizeShare="20">
+            <div dojoType="TreeNode" title="Item 1">
+                <div dojoType="TreeNode" title="Item 1.1"><br/></div> 
+                <div dojoType="TreeNode" title="Item 1.2">
+                    <div dojoType="TreeNode" title="Item 1.2.1"></div>
+                    <div dojoType="TreeNode" title="Item 1.2.2"></div>
+                </div>
+                <div dojoType="TreeNode" title="Item 1.3">
+                    <div dojoType="TreeNode" title="Item 1.3.1"></div>
+                    <div dojoType="TreeNode" title="Item 1.3.2"></div>
+                </div>
+                <div dojoType="TreeNode" title="Item 1.4">
+                    <div dojoType="TreeNode" title="Item 1.4.1"></div>
+                </div>
+            </div>
+            <div>
+<ul>
+#foreach($permission in $permissions)
+<li>$permission</li>
+#end
+</ul>            
+            </div>
+        </div>
+        <div id="mainTabContainer" dojoType="TabContainer" style="width: 100%; height: 70%" selectedTab="tab1">
+            <div id="tab1" dojoType="ContentPane" label="Tab 1">
+                <p>I'm the first tab and my content is local.  Try clicking tab#2.  It's loading remotely.</p>
+            </div>
+            <div id="tab2" dojoType="ContentPane" label="Tab 2">
+                <h1>2nd Tab</h1>
+                I'm the second tab and my content is local.  Try clicking tab#2.  It's loading remotely.
+            </div>        
+        </div>
+      </div>
+
+</div>
+
+
+

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/customizer/customizer.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/customizer/customizer.vm?rev=412538&r1=412537&r2=412538&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/customizer/customizer.vm (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/customizer/customizer.vm Wed Jun  7 13:55:14 2006
@@ -17,11 +17,11 @@
 <head>
 <script type="text/javascript">
 
-    var djConfig = {isDebug: true, baseRelativePath: "./", baseScriptUri: "http://localhost:8080/j2-admin/dojo/"};
+    var djConfig = {isDebug: true, baseRelativePath: "./", baseScriptUri: "http://localhost:8080/jetspeed/javascript/dojo/"};
     //djConfig.debugAtAllCosts = true;
 
 </script>
-<script type="text/javascript" src="http://localhost:8080/j2-admin/dojo/dojo.js"></script>
+<script type="text/javascript" src="http://localhost:8080/jetspeed/java/script/dojo/dojo.js"></script>
 <script language="JavaScript" type="text/javascript">
     dojo.require("dojo.lang.*");
     dojo.require("dojo.dnd.*");



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org