Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions TubesII/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><!-- Commands such as Run, Debug, and Test only use this build script if --><!-- the Compile on Save feature is turned off for the project. --><!-- You can turn off the Compile on Save (or Deploy on Save) setting --><!-- in the project's Project Properties dialog box.--><project name="TubesII" default="default" basedir=".">
<description>Builds, tests, and runs the project TubesII.</description>
<import file="nbproject/build-impl.xml"/>
<!--

There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:

-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-dist: called before archive building
-post-dist: called after archive building
-post-clean: called after cleaning build products
-pre-run-deploy: called before deploying
-post-run-deploy: called after deploying

Example of pluging an obfuscator after the compilation could look like

<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>

For list of available properties check the imported
nbproject/build-impl.xml file.


Other way how to customize the build is by overriding existing main targets.
The target of interest are:

init-macrodef-javac: defines macro for javac compilation
init-macrodef-junit: defines macro for junit execution
init-macrodef-debug: defines macro for class debugging
do-dist: archive building
run: execution of project
javadoc-build: javadoc generation

Example of overriding the target for project execution could look like

<target name="run" depends="<PROJNAME>-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>

Notice that overridden target depends on jar target and not only on
compile target as regular run target does. Again, for list of available
properties which you can use check the target you are overriding in
nbproject/build-impl.xml file.

-->
</project>
2 changes: 2 additions & 0 deletions TubesII/build/web/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0

4 changes: 4 additions & 0 deletions TubesII/build/web/META-INF/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/TubesII">
<Resource auth="Container" type="javax.sql.DataSource" maxActive="50" maxIdle="30" maxWait="10000" name="jdbc/test" username="root" password="" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/blog"/>
</Context>
Empty file.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added TubesII/build/web/WEB-INF/lib/jsf-api.jar
Binary file not shown.
Binary file added TubesII/build/web/WEB-INF/lib/jsf-impl.jar
Binary file not shown.
Binary file added TubesII/build/web/WEB-INF/lib/jstl.jar
Binary file not shown.
Binary file added TubesII/build/web/WEB-INF/lib/standard.jar
Binary file not shown.
38 changes: 38 additions & 0 deletions TubesII/build/web/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<resource-ref>
<description>MySQL DataSource Example</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>load_comment</servlet-name>
<servlet-class>aksesdata.load_comment</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>load_comment</servlet-name>
<url-pattern>/load_comment/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
121 changes: 121 additions & 0 deletions TubesII/build/web/daftar_post.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?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">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<f:view>
<h:head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="Deskripsi Blog" />
<meta name="author" content="Judul Blog" />

<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="omfgitsasalmon" />
<meta name="twitter:title" content="Simple Blog" />
<meta name="twitter:description" content="Deskripsi Blog" />
<meta name="twitter:creator" content="Simple Blog" />
<meta name="twitter:image:src" content="{{! TODO: ADD GRAVATAR URL HERE }}" />

<meta property="og:type" content="article" />
<meta property="og:title" content="Simple Blog" />
<meta property="og:description" content="Deskripsi Blog" />
<meta property="og:image" content="{{! TODO: ADD GRAVATAR URL HERE }}" />
<meta property="og:site_name" content="Simple Blog" />

<link rel="stylesheet" type="text/css" href="assets/css/screen.css" />
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" />

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<title>Simple Blog</title>
<h:outputStylesheet library="css" name="screen.css"/>
</h:head>

<h:body>

<div class="wrapper">
<nav class="nav">
<a style="border:none;" id="logo" href="index.php"><h1>Simple<span>-</span>Blog</h1></a>
<ul class="nav-primary">
<li><h:outputLink value="new_post.xhtml">+ Tambah Post</h:outputLink>
</li>
<li><h:outputLink value="unpublished.xhtml" rendered="#{loginHandler.admin or loginHandler.editor}">See Unpublished</h:outputLink>
</li>
<li><h:outputLink value="index.xhtml" rendered="#{loginHandler.admin}"> User Management</h:outputLink>
</li>
</ul>
</nav>
<div id="home">
<div class="posts">
<nav class="art-list">
<ul class="art-list-body">
<c:forEach items="#{customerBean.customerList}" var="c">
<li class="art-list-item">
<div class="art-list-item-title-and-time">
<h:outputLink value="view_post.xhtml">
<h2 class="art-list-title">
<h:outputText value="#{c.judul}" />
<f:param name="id" value="#{c.id}" />
</h2>
</h:outputLink>


<div class="art-list-time">#{c.tanggal}</div>
<div class="art-list-time"><span style="color:#F40034;">&#10029;</span> Featured</div>
</div>
<p>#{c.isi}</p>
<p><h:form>
<h:outputLink value="editpost.xhtml">Edit<f:param name="id" value="#{c.id}"/></h:outputLink> | <h:commandLink title="Hapus" onclick="return confirm('Apakah Anda yakin menghapus post ini?')" action="#{newpost.deletePost(c.id)}">Hapus</h:commandLink></h:form>
</p>
</li>
</c:forEach>
</ul>
</nav>
</div>
</div>

<footer class="footer">
<div class="back-to-top"><a href="">Back to top</a></div>
<!-- <div class="footer-nav"><p></p></div> -->
<div class="psi">&Psi;</div>
<aside class="offsite-links">
Asisten IF3110 /
<a class="rss-link" href="#rss">RSS</a> /
<br></br>
<a class="twitter-link" href="http://twitter.com/YoGiiSinaga">Yogi</a> /
<a class="twitter-link" href="http://twitter.com/sonnylazuardi">Sonny</a> /
<a class="twitter-link" href="http://twitter.com/fathanpranaya">Fathan</a> /
<br/>
<a class="twitter-link" href="#">Renusa</a> /
<a class="twitter-link" href="#">Kelvin</a> /
<a class="twitter-link" href="#">Yanuar</a> /

</aside>
</footer>

</div>

<script type="text/javascript" src="assets/js/fittext.js"></script>
<script type="text/javascript" src="assets/js/app.js"></script>
<script type="text/javascript" src="assets/js/respond.min.js"></script>
<script type="text/javascript">
var ga_ua = '{{! TODO: ADD GOOGLE ANALYTICS UA HERE }}';

(function(g,h,o,s,t,z){g.GoogleAnalyticsObject=s;g[s]||(g[s]=
function(){(g[s].q=g[s].q||[]).push(arguments)});g[s].s=+new Date;
t=h.createElement(o);z=h.getElementsByTagName(o)[0];
t.src='//www.google-analytics.com/analytics.js';
z.parentNode.insertBefore(t,z)}(window,document,'script','ga'));
ga('create',ga_ua);ga('send','pageview');
</script>

</h:body>
</f:view>
</html>
77 changes: 77 additions & 0 deletions TubesII/build/web/default.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?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">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<h:head>
<h:outputStylesheet library="css" name="table-style.css" />
</h:head>
<h:body>

<h1>JSF 2 dataTable example</h1>
<h:form>
<h:dataTable value="#{order.orderList}" var="o"
styleClass="order-table"
headerClass="order-table-header"
rowClasses="order-table-odd-row,order-table-even-row"
>

<h:column>

<f:facet name="header">Order No</f:facet>

<h:inputText value="#{o.orderNo}" size="10" rendered="#{o.editable}" />

<h:outputText value="#{o.orderNo}" rendered="#{not o.editable}" />

</h:column>

<h:column>

<f:facet name="header">Product Name</f:facet>

<h:inputText value="#{o.productName}" size="20" rendered="#{o.editable}" />

<h:outputText value="#{o.productName}" rendered="#{not o.editable}" />

</h:column>

<h:column>

<f:facet name="header">Price</f:facet>

<h:inputText value="#{o.price}" size="10" rendered="#{o.editable}" />

<h:outputText value="#{o.price}" rendered="#{not o.editable}" />

</h:column>

<h:column>

<f:facet name="header">Quantity</f:facet>

<h:inputText value="#{o.qty}" size="5" rendered="#{o.editable}" />

<h:outputText value="#{o.qty}" rendered="#{not o.editable}" />

</h:column>

<h:column>

<f:facet name="header">Action</f:facet>

<h:commandLink value="Edit" action="#{order.editAction(o)}" rendered="#{not o.editable}" />

</h:column>

</h:dataTable>

<h:commandButton value="Save Changes" action="#{order.saveAction}" />

</h:form>
</h:body>

</html>
Loading