forked from gatein/gatein-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vrockai
committed
Feb 13, 2013
1 parent
5533719
commit f818208
Showing
16 changed files
with
701 additions
and
942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
...ets/navigation/src/main/java/org/gatein/portlet/responsive/navigation/NavigationBean.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 38 additions & 29 deletions
67
.../navigation/src/main/java/org/gatein/portlet/responsive/navigation/NavigationPortlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,61 @@ | ||
/****************************************************************************** | ||
* JBoss, a division of Red Hat * | ||
* Copyright 2011, Red Hat Middleware, LLC, and individual * | ||
* contributors as indicated by the @authors tag. See the * | ||
* copyright.txt in the distribution for a full listing of * | ||
* individual contributors. * | ||
* * | ||
* This is free software; you can redistribute it and/or modify it * | ||
* under the terms of the GNU Lesser General Public License as * | ||
* published by the Free Software Foundation; either version 2.1 of * | ||
* the License, or (at your option) any later version. * | ||
* * | ||
* This software is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | ||
* Lesser General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU Lesser General Public * | ||
* License along with this software; if not, write to the Free * | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. * | ||
******************************************************************************/ | ||
/** | ||
* **************************************************************************** | ||
* JBoss, a division of Red Hat * Copyright 2012, Red Hat Middleware, LLC, and individual * contributors as indicated by the | ||
* @authors tag. See the * copyright.txt in the distribution for a full listing of * individual contributors. * * This is free | ||
* software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by | ||
* the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is | ||
* distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You | ||
* should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. * | ||
***************************************************************************** | ||
*/ | ||
package org.gatein.portlet.responsive.navigation; | ||
|
||
import java.io.IOException; | ||
|
||
import java.util.List; | ||
import javax.portlet.GenericPortlet; | ||
import javax.portlet.PortletException; | ||
import javax.portlet.PortletRequestDispatcher; | ||
import javax.portlet.RenderRequest; | ||
import javax.portlet.RenderResponse; | ||
import javax.portlet.PortletRequestDispatcher; | ||
import org.gatein.api.PortalRequest; | ||
import org.gatein.api.navigation.Navigation; | ||
import org.gatein.api.navigation.Node; | ||
import org.gatein.api.navigation.NodePath; | ||
import org.gatein.api.navigation.Nodes; | ||
|
||
/** | ||
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a> | ||
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a> | ||
* @version $Revision$ | ||
*/ | ||
public class NavigationPortlet extends GenericPortlet { | ||
|
||
NavigationBean navigationBean; | ||
NavigationNodeBean navigationRootNodeBean; | ||
|
||
public NavigationPortlet() { | ||
this.navigationBean = new NavigationBean(); | ||
|
||
} | ||
|
||
@Override | ||
protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { | ||
request.setAttribute("navigation", navigationBean); | ||
|
||
PortalRequest portalRequest = PortalRequest.getInstance(); | ||
|
||
Navigation navigation = portalRequest.getNavigation(); | ||
Node rootNode = navigation.getRootNode(Nodes.ALL); | ||
|
||
navigationRootNodeBean = new NavigationNodeBean(rootNode); | ||
|
||
/* Setting the 1st node to be active when accesing the root node "/" */ | ||
List<NavigationNodeBean> rootNodeChildrenList = navigationRootNodeBean.getChildren(); | ||
|
||
if (!rootNodeChildrenList.isEmpty() && portalRequest.getNodePath().equals(NodePath.root())){ | ||
rootNodeChildrenList.get(0).setActive(true); | ||
} | ||
|
||
request.setAttribute("navigationRootNode", navigationRootNodeBean); | ||
PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/navigation.jsp"); | ||
prd.include(request, response); | ||
} | ||
|
||
} |
9 changes: 3 additions & 6 deletions
9
.../portlets/navigation/src/main/resources/locale/portlet/responsivenavigation_en.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
label.SignIn=Sign in | ||
label.Register=Register | ||
label.SignOut=Sign Out | ||
label.UserProfile=Profile | ||
label.Dashboard=Dashboard | ||
label.GroupPages=Group Pages | ||
label.show=Show navigation | ||
label.hide=Hide navigation | ||
label.children=Show children nodes |
96 changes: 75 additions & 21 deletions
96
mobile-integration/portlets/navigation/src/main/webapp/WEB-INF/gatein-resources.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,81 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<gatein-resources | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_3 http://www.gatein.org/xml/ns/gatein_resources_1_3" | ||
xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_3"> | ||
|
||
<portlet-skin> | ||
<application-name>responsive-navigation-portlet</application-name> | ||
<portlet-name>ResponsiveNavigationPortlet</portlet-name> | ||
<css-path>/css/ResponsiveStylesheet.css</css-path> | ||
</portlet-skin> | ||
|
||
<portlet> | ||
<name>ResponsiveNavigationPortlet</name> | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_3 http://www.gatein.org/xml/ns/gatein_resources_1_3" | ||
xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_3"> | ||
|
||
<module> | ||
<name>collapsiblecontainer_jquery</name> | ||
<script> | ||
<path>/js/collapsiblecontainer.jquery.js</path> | ||
</script> | ||
<depends> | ||
<module>jquery</module> | ||
<as>jQuery</as> | ||
</depends> | ||
</module> | ||
|
||
<!-- DropDown menu is supported from the header portlet right now | ||
<module> | ||
<name>dropdownmenu_jquery</name> | ||
<script> | ||
<path>/js/dropdownmenu.jquery.js</path> | ||
</script> | ||
<depends> | ||
<module>jquery</module> | ||
<as>jQuery</as> | ||
</depends> | ||
</module> | ||
--> | ||
|
||
<module> | ||
<script> | ||
<name>navigation</name> | ||
<path>/js/navigation.js</path> | ||
</script> | ||
<depends> | ||
<module>jquery</module> | ||
<as>jQuery</as> | ||
</depends> | ||
<name>org_gatein_navigation</name> | ||
<script> | ||
<path>/js/navigation.js</path> | ||
</script> | ||
<depends> | ||
<module>jquery</module> | ||
<as>jQuery</as> | ||
</depends> | ||
<!-- DropDown menu is supported from the header portlet right now | ||
<depends> | ||
<module>dropdownmenu_jquery</module> | ||
</depends> | ||
--> | ||
<depends> | ||
<module>collapsiblecontainer_jquery</module> | ||
</depends> | ||
</module> | ||
</portlet> | ||
|
||
<portlet-skin> | ||
<application-name>responsive-navigation-portlet</application-name> | ||
<portlet-name>ResponsiveNavigationPortlet</portlet-name> | ||
<css-path>/css/ResponsiveStylesheet.css</css-path> | ||
</portlet-skin> | ||
|
||
<portlet> | ||
<name>ResponsiveNavigationPortlet</name> | ||
|
||
<module> | ||
<depends> | ||
<module>org_gatein_navigation</module> | ||
</depends> | ||
|
||
<depends> | ||
<module>collapsiblecontainer_jquery</module> | ||
</depends> | ||
|
||
<!-- DropDown menu is supported from the header portlet right now | ||
<depends> | ||
<module>dropdownmenu_jquery</module> | ||
</depends> | ||
--> | ||
|
||
<depends> | ||
<module>jquery</module> | ||
<as>jQuery</as> | ||
</depends> | ||
</module> | ||
</portlet> | ||
|
||
</gatein-resources> |
Oops, something went wrong.