Skip to content

Commit

Permalink
Documentation section is now dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Apr 9, 2014
1 parent 2eb937c commit 8cbc479
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 159 deletions.
41 changes: 41 additions & 0 deletions src/main/java/org/jboss/forge/website/model/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
Expand Down Expand Up @@ -35,6 +37,15 @@ public class Document implements Serializable
@Column
private String path;

@Column
private String title;

@Column
private String description;

@Enumerated(EnumType.ORDINAL)
private DocumentCategory category;

public Long getId()
{
return this.id;
Expand Down Expand Up @@ -128,4 +139,34 @@ public String toString()
result += ", path: " + path;
return result;
}

public String getTitle()
{
return title;
}

public void setTitle(String title)
{
this.title = title;
}

public String getDescription()
{
return description;
}

public void setDescription(String description)
{
this.description = description;
}

public DocumentCategory getCategory()
{
return category;
}

public void setCategory(DocumentCategory category)
{
this.category = category;
}
}
17 changes: 17 additions & 0 deletions src/main/java/org/jboss/forge/website/model/DocumentCategory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2014 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/

package org.jboss.forge.website.model;

/**
*
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
public enum DocumentCategory
{
GET_STARTED, TUTORIALS, ADVANCED
}
22 changes: 22 additions & 0 deletions src/main/webapp/admin/document/create.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@
<h:message for="documentBeanDocumentPath" styleClass="error"/>
</h:panelGroup>
<h:outputText/>
<h:outputLabel for="documentBeanDocumentTitle" value="Title:"/>
<h:panelGroup>
<h:inputText id="documentBeanDocumentTitle" value="#{documentBean.document.title}"/>
<h:message for="documentBeanDocumentTitle" styleClass="error"/>
</h:panelGroup>
<h:outputText/>
<h:outputLabel for="documentBeanDocumentDescription" value="Description:"/>
<h:panelGroup>
<h:inputText id="documentBeanDocumentDescription" value="#{documentBean.document.description}"/>
<h:message for="documentBeanDocumentDescription" styleClass="error"/>
</h:panelGroup>
<h:outputText/>
<h:outputLabel for="documentBeanDocumentCategory" value="Category:"/>
<h:panelGroup>
<h:selectOneMenu id="documentBeanDocumentCategory" value="#{documentBean.document.category}" required="true">
<f:selectItem itemLabel="Get Started" itemValue="GET_STARTED" />
<f:selectItem itemLabel="Tutorials" itemValue="TUTORIALS"/>
<f:selectItem itemLabel="Advanced" itemValue="ADVANCED"/>
</h:selectOneMenu>
<h:message for="documentBeanDocumentCategory" styleClass="error"/>
</h:panelGroup>
<h:outputText/>
</h:panelGrid>

<div class="buttons">
Expand Down
52 changes: 28 additions & 24 deletions src/main/webapp/document.xhtml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" template="/resources/scaffold/mainTemplate.xhtml">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" template="/resources/scaffold/mainTemplate.xhtml">
<f:metadata>
<f:viewParam name="id" value='#{documentBean.id}' />
<f:event type="preRenderView" listener='#{documentBean.retrieve}' />
</f:metadata>
<ui:param name="pageTitle" value="Documentation | JBoss Forge" />
<ui:define name="main">

<!-- Breadcrumbs -->
<div class="row text-left">
<div class="col-sm-10 margin-20">
<a href="index.xhtml">JBoss Forge</a> &rsaquo; <a href="documentation.xhtml">Documentation</a> &rsaquo; Installation and Getting Started
<a href="index.xhtml">JBoss Forge</a> &rsaquo;
<h:link outcome="/documentation">Documentation</h:link>
&rsaquo; Installation and Getting Started
</div>
</div>

Expand All @@ -24,38 +30,36 @@
</form>
</div>
<!--/ Search -->

<!-- Table of Contents -->
<h4>Table of Contents</h4>
<p>
<ul>
<li><a href="#">Install a Forge Distribution</a></li>
<li><a href="#">Getting help</a></li>
<li><a href="#">Start a basic Java EE webapp</a></li>
<li><a href="#">Install addons</a></li>
</ul>
<ul>
<li><a href="#">Install a Forge Distribution</a></li>
<li><a href="#">Getting help</a></li>
<li><a href="#">Start a basic Java EE webapp</a></li>
<li><a href="#">Install addons</a></li>
</ul>
</p>
<!--/ Table of Contents -->
<!-- Recommended Docs -->

<!-- Recommended Docs -->
<h4>Other Forge Documents</h4>
<p>
<ul>
<li><a href="#">Recommended doc</a></li>
<li><a href="#">Recommended doc</a></li>
<li><a href="#">Recommended doc</a></li>
<li><a href="#">Recommended doc</a></li>
</ul>
<ul>
<li><a href="#">Recommended doc</a></li>
<li><a href="#">Recommended doc</a></li>
<li><a href="#">Recommended doc</a></li>
<li><a href="#">Recommended doc</a></li>
</ul>
</p>

</div>

<!-- Doc -->
<div class="col-sm-9">
<div class="widget-container widget-doc boxed">
<!-- Doc content here -->
<h2>TEST CONTENT</h2>
<p>Info would go here</p>
<div class="widget-container widget-doc boxed preview">
<h:outputText escape="false" value="#{documentBean.getDocumentHTML()}" />
</div>
</div>
<!--/ Doc -->
Expand Down
157 changes: 22 additions & 135 deletions src/main/webapp/documentation.xhtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" template="/resources/scaffold/mainTemplate.xhtml">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" template="/resources/scaffold/mainTemplate.xhtml">
<f:metadata>
<f:viewParam name="page" value='#{documentBean.page}' />
<f:event type="preRenderView" listener='#{documentBean.paginate}' />
</f:metadata>
<ui:param name="pageTitle" value="Documentation | JBoss Forge" />
<ui:define name="main">
<!-- Intro -->
Expand Down Expand Up @@ -36,143 +40,26 @@
</div>
</div>


<div class="row row-equal">
<!-- Doc -->
<div class="col-md-4 col-equal">
<div class="widget-container widget-document boxed">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Installation Guide</h5>
<span class="subtitle"><p>Installing Forge is a relatively short process, and this guide will take you through the fundamentals.</p>
<p>We'll show you how to install using various methods, and a quick getting started walkthrough of using Forge.</p></span>
<div class="btn btn-caps">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
<!--/ Doc -->
<!-- Doc -->
<div class="col-md-4 col-equal">
<div class="widget-container widget-document boxed">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Reference Guide</h5>
<p class="subtitle">The cheatsheet you can print out or reference when you can't quite remember the command you are looking for.</p>
<div class="btn btn-caps">
<a href="#"><span>View</span></a>

</div>
</div>
</div>
</div>
<!--/ Doc -->
<!-- Doc -->
<div class="col-md-4 col-equal">
<div class="widget-container widget-document boxed">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Installing Addons</h5>
<p class="subtitle">Addons are a fundamental piece of getting Forge to work the way you want it to. Here we'll tell you how to get and install the latest addons.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
<!--/ Doc -->
</div>
<div class="row row-equal">
<!-- Doc -->
<div class="col-md-4 col-equal boxed">
<div class="widget-container widget-document">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Writing a basic Java EE app</h5>
<p class="subtitle">This tutorial will show you how to write a basic Java EE app from start to finish, and deploy it on a JBoss AS7 server.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-equal boxed">
<div class="widget-container widget-document">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Testing with Forge</h5>
<p class="subtitle">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-equal boxed">
<div class="widget-container widget-document">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>UI Scaffolding</h5>
<p class="subtitle">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
</div>
<div class="row row-equal">
<div class="col-md-4 col-equal boxed">
<div class="widget-container widget-document">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Configure HTTP Proxy</h5>
<p class="subtitle">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-equal boxed">
<div class="widget-container widget-document">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Creating a Forge Addon</h5>
<p class="subtitle">If you want to have Forge work with technology that you currently use but there isn't already an addon for it, you can easily create your own addons that work with Forge. This guide will take you step-by-step through how to create your own addon.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
<ui:repeat var="item" value="#{documentBean.pageItems}">
<div class="row row-equal">
<!-- Doc -->
<div class="col-md-4 col-equal">
<div class="widget-container widget-document boxed">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5><h:outputText value="#{item.title}"/></h5>
<span class="subtitle"><p><h:outputText value="#{item.description}"/></p></span>
<div class="btn btn-caps">
<h:link outcome="/document">
<f:param name="id" value="#{item.id}" />
<span>View</span>
</h:link>
</div>
</div>
</div>
</div>
<!--/ Doc -->
</div>
<div class="col-md-4 col-equal boxed">
<div class="widget-container widget-document">
<div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Profiling Forge</h5>
<p class="subtitle">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
</div>
<div class="row row-equal">
<div class="col-md-4 col-equal boxed">
<div class="widget-container widget-document"> <div class="inner clearfix">
<span class="btn-lg glyphicon glyphicon-ok-circle lightIcon"></span>
<h5>Debugging Forge</h5>
<p class="subtitle">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque.</p>
<div class="btn btn-caps margin-10">
<a href="#"><span>View</span></a>
</div>
</div>
</div>
</div>
<!--/ Doc -->
</div>
</ui:repeat>
</ui:define>
</ui:composition>

0 comments on commit 8cbc479

Please sign in to comment.