It works but the output is broken :)

This commit is contained in:
2024-03-21 17:08:36 -05:00
parent 39b0da17b9
commit 118d95a69d
219 changed files with 7927 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
*/
package edu.slcc.asdv.beans;
import jakarta.inject.Named;
import jakarta.faces.view.ViewScoped;
import java.io.Serializable;
import java.util.ArrayList;
/**
*
* @author A. V. Markou
*/
@Named(value = "matrixBeanA")
@ViewScoped
public class MatrixBeanA implements Serializable
{
ArrayList<ArrayList<String>> matrix = new ArrayList<ArrayList<String>>();
public MatrixBeanA()
{
ArrayList<String> row1 = new ArrayList<String>();
ArrayList<String> row2 = new ArrayList<String>();
row1.add("1");
row1.add("1");
row2.add("3");
row2.add("2");
matrix = new ArrayList<ArrayList<String>>();
matrix.add(row1);
matrix.add(row2);
}
public void listenForKeyUp(int i, int j, String input)
{
System.out.println("i=" + i);
System.out.println("j=" + j);
System.out.println("input=" + input);
matrix.get(i).set(j, input);
}
public ArrayList<ArrayList<String>> getMatrix()
{
return matrix;
}
}

View File

@@ -0,0 +1,50 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
*/
package edu.slcc.asdv.beans;
import jakarta.inject.Named;
import jakarta.faces.view.ViewScoped;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import org.primefaces.PrimeFaces;
/**
*
* @author A. V. Markou
*/
@Named(value = "matrixBeanB")
@ViewScoped
public class MatrixBeanB implements Serializable
{
ArrayList<ArrayList<String>> matrix = new ArrayList<ArrayList<String>>();
public MatrixBeanB()
{
ArrayList<String> row1 = new ArrayList<String>();
ArrayList<String> row2 = new ArrayList<String>();
row1.add("4");
row1.add("5");
row2.add("6");
row2.add("7");
matrix = new ArrayList<ArrayList<String>>();
matrix.add(row1);
matrix.add(row2);
}
public void listenForKeyUp(int i, int j, String input)
{
System.out.println("i=" + i);
System.out.println("j=" + j);
System.out.println("input=" + input);
matrix.get(i).set(j, input);
}
public ArrayList<ArrayList<String>> getMatrix()
{
return matrix;
}
}

View File

@@ -0,0 +1,49 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
*/
package edu.slcc.asdv.beans;
import jakarta.inject.Named;
import jakarta.faces.view.ViewScoped;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
/**
*
* @author A. V. Markou
*/
@Named(value = "matrixBeanC")
@ViewScoped
public class MatrixBeanC implements Serializable
{
ArrayList<ArrayList<String>> matrix = new ArrayList<ArrayList<String>>();
public MatrixBeanC()
{
ArrayList<String> row1 = new ArrayList<String>();
ArrayList<String> row2 = new ArrayList<String>();
row1.add("-1");
row1.add("-1");
row2.add("-1");
row2.add("-1");
matrix = new ArrayList<ArrayList<String>>();
matrix.add(row1);
matrix.add(row2);
}
public ArrayList<ArrayList<String>> getMatrix()
{
return matrix;
}
public void setMatrixC(ArrayList<ArrayList<String>> matrix)
{
this.matrix = matrix;
}
}

View File

@@ -0,0 +1,87 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
*/
package edu.slcc.asdv.beans;
import jakarta.inject.Named;
import jakarta.faces.view.ViewScoped;
import jakarta.inject.Inject;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.ArrayList;
/**
*
* @author A. V. Markou
*/
@Named(value = "matrixOperations")
@ViewScoped
public class MatrixOperations implements Serializable
{
@Inject
MatrixBeanA matrixA;
@Inject
MatrixBeanB matrixB;
@Inject
MatrixBeanC matrixC;
edu.slcc.asdv.bl.Matrices matrixManipulator = new edu.slcc.asdv.bl.Matrices();
public String add(){
ArrayList<ArrayList<BigInteger>> a = convertToBigInteger(matrixA.getMatrix());
ArrayList<ArrayList<BigInteger>> b = convertToBigInteger(matrixA.getMatrix());
ArrayList<ArrayList<String>> c = new ArrayList<ArrayList<String>>();
c = convertToString(matrixManipulator.addParallel(a, b));
matrixC.setMatrixC( c );
return "";
}
public String multiply() {
ArrayList<ArrayList<BigInteger>> a = convertToBigInteger(matrixA.getMatrix());
ArrayList<ArrayList<BigInteger>> b = convertToBigInteger(matrixA.getMatrix());
ArrayList<ArrayList<String>> c = new ArrayList<ArrayList<String>>();
c = convertToString(matrixManipulator.multiplyParallel(a, b));
matrixC.setMatrixC( c );
return "";}
public MatrixBeanC getMatrixC(){return this.matrixC;}
public MatrixBeanA getMatrixA(){return matrixA;}
public MatrixBeanB getMatrixB(){return matrixB;}
public ArrayList<ArrayList<BigInteger>> convertToBigInteger(ArrayList<ArrayList<String>> matrix) {
ArrayList<ArrayList<BigInteger>> bigInt2DArray = new ArrayList<>();
for (int i = 0; i < matrix.size(); i++) {
ArrayList<BigInteger> columnArray = new ArrayList<BigInteger>();
for (int j = 0; j < matrix.get(i).size(); j++) {
String cellValue = matrix.get(i).get(j);
columnArray.add(new BigInteger(cellValue));
}
bigInt2DArray.add(columnArray);
}
return bigInt2DArray;
}
public ArrayList<ArrayList<String>> convertToString(ArrayList<ArrayList<BigInteger>> matrix) {
int numRows = matrix.size();
int numCols = matrix.get(0).size();
ArrayList<ArrayList<String>> string2DArray = new ArrayList<>();
for (int i = 0; i < matrix.size(); ++i) {
ArrayList<String> columnArray = new ArrayList<>();
for (int j = 0; j < matrix.get(i).size(); ++j) {
BigInteger cellValue = matrix.get(i).get(j);
columnArray.add(cellValue.toString());
}
string2DArray.add(columnArray);
}
return string2DArray;
}
}

View File

@@ -0,0 +1,78 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
*/
package edu.slcc.asdv.beans;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.application.FacesMessage.Severity;
import jakarta.faces.context.FacesContext;
import jakarta.inject.Named;
import jakarta.faces.view.ViewScoped;
import jakarta.inject.Inject;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.primefaces.PrimeFaces;
@Named(value = "menuBar")
@ViewScoped
public class MenuBar implements Serializable
{
@Inject
MatrixOperations matrixOperations;
private List<List<Object>> menus = new ArrayList<List<Object>>();
public void add()
{
System.out.println("menu add was called");
System.out.println("menu bar add()");
matrixOperations.add();///adition of matrices
System.out.println(matrixOperations.getMatrixC());
List<String> idsC = new ArrayList();
idsC.add("formC");
idsC.add("formC:datatableC");
idsC.add("formC:datatableC:columnsC");
idsC.add("formC:datatableC:columnsC:inputTextC");
//idsC.add("form-menu");//:menuBar:submenu_matrices:menuitem_add");
PrimeFaces.current().ajax().update(idsC);
}
public void multiply()
{
System.out.println("menu multiply was called");
System.out.println("menu bar multiply()");
matrixOperations.multiply();///adition of matrices
System.out.println(matrixOperations.getMatrixC());
List<String> idsC = new ArrayList();
idsC.add("formC");
idsC.add("formC:datatableC");
idsC.add("formC:datatableC:columnsC");
idsC.add("formC:datatableC:columnsC:inputTextC");
//idsC.add("form-menu");//:menuBar:submenu_matrices:menuitem_add");
PrimeFaces.current().ajax().update(idsC);
}
public void subtract()
{
message(
FacesMessage.SEVERITY_INFO,
"Not implemented.", "To be implemented."
);
}
public void message(Severity severity, String msg, String msgDetails)
{
FacesMessage m = new FacesMessage(severity, msg, msgDetails);
FacesContext.getCurrentInstance().addMessage("msg", m);
}
}

View File

@@ -0,0 +1,265 @@
package edu.slcc.asdv.bl;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.RecursiveTask;
/**
*
* @author A. V. Markou
*/
public class Matrices implements Matrix
{
@Override
public ArrayList<ArrayList<BigInteger>> addParallel(ArrayList<ArrayList<BigInteger>> A, ArrayList<ArrayList<BigInteger>> B)
{
RecursiveTask<ArrayList<ArrayList<BigInteger>>> rt
= new Matrices.MatricesAddition(0, A.size() - 1, A, B);
ForkJoinPool pool = new ForkJoinPool();
ArrayList<ArrayList<BigInteger>> result = pool.invoke(rt);
return result;
}
@Override
public ArrayList<ArrayList<BigInteger>> multiplyParallel(ArrayList<ArrayList<BigInteger>> A, ArrayList<ArrayList<BigInteger>> B)
{
RecursiveTask<ArrayList<ArrayList<BigInteger>>> rt
= new Matrices.MatricesMultiplication(0, A.size() - 1, A, B);
ForkJoinPool pool = new ForkJoinPool();
ArrayList<ArrayList<BigInteger>> result = pool.invoke(rt);
return result;
}
static class MatricesAddition extends RecursiveTask<ArrayList<ArrayList<BigInteger>>>
{
ArrayList<ArrayList<BigInteger>> A;
ArrayList<ArrayList<BigInteger>> B;
ArrayList<ArrayList<BigInteger>> AplusB;
final int HOW_MANY_ROWS_IN_PARALLEL = 100;//threshold
int startIndex;
int endIndex;
public MatricesAddition(int startIndex, int endIndex,
ArrayList<ArrayList<BigInteger>> A,
ArrayList<ArrayList<BigInteger>> B)
{
this.startIndex = startIndex;//start at this row of the matrix
this.endIndex = endIndex;//end at this row of the matrix
this.A = A;
this.B = B;
AplusB = new ArrayList<ArrayList<BigInteger>>();
}
@Override
protected ArrayList<ArrayList<BigInteger>> compute()
{
//>>This is the addition of matrices in the IF.
//That is, HOW_MANY_ROWS_IN_PARALLEL from matrix A and HOW_MANY_ROWS_IN_PARALLEL from matrix B
if (this.endIndex - this.startIndex < HOW_MANY_ROWS_IN_PARALLEL)
{
ArrayList<ArrayList<BigInteger>> resultC = new ArrayList<ArrayList<BigInteger>>();
for (int i = this.startIndex; i <= this.endIndex; ++i)
{
//>create a new row to add it to the resulting matrix resultC
ArrayList<BigInteger> rowAplusB = new ArrayList<BigInteger>();
for (int j = 0; j < A.get(0).size(); j++)
//>get the Ith row from A and the Ith row from B and
//and add all the Jth entries from each row
{
BigInteger x = A.get(i).get(j);
BigInteger y = B.get(i).get(j);
BigInteger z = x.add(y);
rowAplusB.add(z);
}
resultC.add(rowAplusB);
}
return resultC;
}
else
{ //>> keep on FORKING the matrix until the
//side of the matric is equal or less to HOW_MANY_ROWS_IN_PARALLEL
int mid = (this.endIndex + this.startIndex) / 2;
RecursiveTask<ArrayList<ArrayList<BigInteger>>> firstHalf
= new MatricesAddition(this.startIndex, mid, A, B);
RecursiveTask<ArrayList<ArrayList<BigInteger>>> secondHalf
= new MatricesAddition(mid + 1, this.endIndex, A, B);
firstHalf.fork();//this line will invoke method compute
secondHalf.fork();///this line will invoke method compute
//>> join what the FORKs returned from the IFs
AplusB.addAll(firstHalf.join());
AplusB.addAll(secondHalf.join());
return AplusB;
}
}
}
/**
* Multiples two lists one 1-t01 correspondence, that is the 1st element of
* the first list is multiplied with 1st elements of the second list and so
* on
*
* @param list1
* @param list2
* @return the multiplied results
*/
public static ArrayList<BigInteger> multiplyLists(ArrayList<BigInteger> list1, ArrayList<BigInteger> list2)
{
ArrayList<BigInteger> resultsOfMultiplications = new ArrayList<BigInteger>();
for (int bi = 0; bi < list1.size();
++bi)
{
resultsOfMultiplications.add(list1.get(bi).multiply(list2.get(bi)));
}
return resultsOfMultiplications;
}
public static ArrayList<ArrayList<BigInteger>> columnMajorOrderReversal(ArrayList<ArrayList<BigInteger>> b)
{
ArrayList<ArrayList<BigInteger>> tranformed = new ArrayList<ArrayList<BigInteger>>();
for (int column = 0;
column < b.get(0).size();
++column)
{
ArrayList<BigInteger> rowTrandormedToColmn = new ArrayList<BigInteger>();
for (int row = 0;
row < b.size();
++row)
{
BigInteger bd = b.get(row).get(column);
rowTrandormedToColmn.add(bd);
}
tranformed.add(rowTrandormedToColmn);
}
return tranformed;
}
/**
* Adds a list of Big Decimals and returns the result of the addition.
*
* @param list - list of BigDecimal type
* @return the sum of the list
*/
public static BigInteger add(ArrayList<BigInteger> list)
{
BigInteger bd = BigInteger.ZERO;
for (int bi = 0; bi < list.size();
bi++)
{
bd = bd.add(list.get(bi));
}
return bd;
}
static class MatricesMultiplication extends RecursiveTask<ArrayList<ArrayList<BigInteger>>>
{
ArrayList<ArrayList<BigInteger>> A;
ArrayList<ArrayList<BigInteger>> B;
ArrayList<ArrayList<BigInteger>> AxB;
final int HOW_MANY_ROWS_IN_PARALLEL = 3;//threshold
int startIndex;
int endIndex;
public MatricesMultiplication(int startIndex, int endIndex,
ArrayList<ArrayList<BigInteger>> A,
ArrayList<ArrayList<BigInteger>> B)
{
this.startIndex = startIndex;//start at this row of the matrix
this.endIndex = endIndex;//end at this row of the matrix
this.A = A;
this.B = B;
AxB = new ArrayList<ArrayList<BigInteger>>();
}
/**
* matrix
* 1, 2, 3
* 4, 5, 6
*
* will be transformed to
* 1, 4
* 2, 5
* 3, 6
*
* @param list
* @return
*/
@Override
protected ArrayList<ArrayList<BigInteger>> compute()
{
//>>This is the addition of matrices in the IF.
//That is, HOW_MANY_ROWS_IN_PARALLEL from matrix A and HOW_MANY_ROWS_IN_PARALLEL from matrix B
if (this.endIndex - this.startIndex < HOW_MANY_ROWS_IN_PARALLEL)
{
ArrayList<ArrayList<BigInteger>> resultC = new ArrayList<ArrayList<BigInteger>>();
ArrayList<ArrayList<BigInteger>> bTransformed = columnMajorOrderReversal(B);
for (int biA = this.startIndex;
biA <= this.endIndex;
++biA)
{
ArrayList<BigInteger> rowA = A.get(biA);
ArrayList<BigInteger> rowAxB = new ArrayList<BigInteger>();
ArrayList<BigInteger> rowCalculation = new ArrayList<BigInteger>();
for (int biB = 0;
biB < bTransformed.size();
++biB)
{
ArrayList<BigInteger> rowB = bTransformed.get(biB);
ArrayList<BigInteger> productsOfRow = multiplyLists(rowA, rowB);
BigInteger sumOfRow = add(productsOfRow);
rowCalculation.add(sumOfRow);
}
resultC.add(rowCalculation);
}
return resultC;
}
else
{ //>> keep on FORKING the matrix until the
//side of the matric is equal or less to HOW_MANY_ROWS_IN_PARALLEL
int mid = (this.startIndex + this.endIndex) / 2;
RecursiveTask<ArrayList<ArrayList<BigInteger>>> firstHalf
= new MatricesMultiplication(this.startIndex, mid, A, B);
RecursiveTask<ArrayList<ArrayList<BigInteger>>> secondHalf
= new MatricesMultiplication(mid + 1, this.endIndex, A, B);
firstHalf.fork();//this line will invoke method compute
secondHalf.fork();///this line will invoke method compute
//>> join what the FORKs returned from the IFs
AxB.addAll(firstHalf.join());
AxB.addAll(secondHalf.join());
return AxB;
}
}
}
}

View File

@@ -0,0 +1,19 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java to edit this template
*/
package edu.slcc.asdv.bl;
import java.math.BigInteger;
import java.util.ArrayList;
/**
*
* @author ASDV1
*/
public interface Matrix
{
ArrayList<ArrayList<BigInteger>> addParallel(ArrayList<ArrayList<BigInteger>> A, ArrayList<ArrayList<BigInteger>> B);
ArrayList<ArrayList<BigInteger>> multiplyParallel(ArrayList<ArrayList<BigInteger>> A, ArrayList<ArrayList<BigInteger>> B);
}

View File

@@ -0,0 +1,20 @@
package edu.slcc.asdv.resources;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Response;
/**
*
* @author
*/
@Path("jakartaee9")
public class JakartaEE9Resource {
@GET
public Response ping(){
return Response
.ok("ping Jakarta EE")
.build();
}
}

View File

@@ -0,0 +1,123 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package edu.slcc.asdv.utilities;
import jakarta.el.ELContext;
import jakarta.el.ELResolver;
import jakarta.faces.application.Application;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.component.UIComponent;
import jakarta.faces.context.FacesContext;
import java.math.BigInteger;
import java.util.ArrayList;
public class Utilities
{
public static UIComponent findComponent(String id)
{
UIComponent result = null;
UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
if (root != null)
{
result = findComponent(root, id);
}
return result;
}
public static UIComponent findComponent(UIComponent root, String id)
{
UIComponent result = null;
if (root.getId().equals(id))
{
return root;
}
for (UIComponent child : root.getChildren())
{
if (child.getId().equals(id))
{
result = child;
break;
}
result = findComponent(child, id);
if (result != null)
{
break;
}
}
return result;
}
public static void printIDs(UIComponent component)
{
System.out.println("\n\nPARENT ID " + component.getId());
if (component.getChildren() == null)
{
return;
}
for (UIComponent child : component.getChildren())
{
System.out.println("\t\tCHILD ID " + child.getId());
printIDs(child);
}
}
public static boolean isNumberOrDecimal( String s )
{
System.out.println("isNumberOrDecimal called " + s);
//[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)
String regx = "^[+-]?(\\d*\\.)?\\d+$";
return s.matches(regx);
}
public static void message( FacesMessage.Severity severity, String msg, String msgDetails)
{
FacesMessage m = new FacesMessage(severity, msg, msgDetails);
FacesContext.getCurrentInstance().addMessage("msg", m);
}
public static <T> T getCDIBean(String nameOfTheBean)
{
ELContext elc = FacesContext.getCurrentInstance().getELContext();
FacesContext fc = FacesContext.getCurrentInstance();
Application ap = fc.getApplication();
ELResolver elr = ap.getELResolver();
return (T) elr.getValue(elc, null, nameOfTheBean);
}
public static ArrayList<ArrayList<String>> convertBigIntegerToString(ArrayList<ArrayList<BigInteger>> matrix)
{
ArrayList<ArrayList<String>> stringMatrix = new ArrayList<ArrayList<String>>();
for (ArrayList<BigInteger> row : matrix)
{
ArrayList<String> stringRow = new ArrayList<String>();
for (BigInteger bigInt : row)
{
stringRow.add(new String(bigInt.toString()));
}
stringMatrix.add(stringRow);
}
return stringMatrix;
}
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="3.0" xmlns="https://jakarta.ee/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd">
<!-- Define Persistence Unit -->
<persistence-unit name="my_persistence_unit">
</persistence-unit>
</persistence>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
bean-discovery-mode="all">
</beans>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
bean-discovery-mode="all">
</beans>

View File

@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
<application>
<resource-bundle>
<base-name>com.pap.messages.messages</base-name>
<var>msgs</var>
</resource-bundle>
</application>
</faces-config>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_mysql_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="serverName" value="localhost"/>
<property name="portNumber" value="8889"/>
<property name="databaseName" value="mysql"/>
<property name="User" value="root"/>
<property name="Password" value="root"/>
<property name="URL" value="jdbc:mysql://localhost:8889/mysql?zeroDateTimeBehavior=CONVERT_TO_NULL"/>
<property name="driverClass" value="com.mysql.cj.jdbc.Driver"/>
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="java:app/exam" object-type="user" pool-name="mysql_mysql_rootPool"/>
</resources>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="5.0" xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">
<context-param>
<param-name>jakarta.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>ServletExcel</servlet-name>
<servlet-class>edu.slcc.asdv.servlets.ServletExcel</servlet-class>
</servlet>
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>edu.slcc.asdv.servlets.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletExcel</servlet-name>
<url-pattern>/ServletExcel</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</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>

View File

@@ -0,0 +1,56 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
<title></title>
</h:head>
<h:body>
<ui:composition
template="resources/templates/generic/generic-layout.xhtml">
<ui:param name="wrapperWidth" value="80%"/>
<ui:define name="title">
Application Software Development, SLCC
</ui:define>
<ui:define name="top">
Templates, and Menus Illustration
</ui:define>
<ui:param name="loginsearch" value="true"/>
<ui:define name="logo"> </ui:define>
<ui:define name="login">
<ui:include src="/login-n-search/login.xhtml"/>
</ui:define>
<ui:define name="search">
<ui:include src="/login-n-search/search.xhtml"/>
</ui:define>
<ui:define name="menu">
<ui:include src="/matrices/menuMatrices.xhtml">
<ui:param name = "isMenu" value="true" />
</ui:include>
</ui:define>
<ui:param name="left" value="false"/>
<!-- if we do NOT want right to appear, set right to false -->
<ui:param name="right" value="false"/>
<ui:param name="content" value="true"/>
<ui:define name="content">
<ui:include src="/matrices/compose.xhtml"/>
</ui:define>
<ui:define name="bottom">ASDV 2800 , Templates</ui:define>
</ui:composition>
<br />
</h:body>
</html>

View File

@@ -0,0 +1,25 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"
xmlns:f5="http://xmlns.jcp.org/jsf/passthrough">
<h:head>
<title>Login</title>
>
</h:head>
<h:body>
<ui:composition>
<h:form id="loginFormId">
<h:inputText styleClass="inputs" value="" f5:type="email" f5:placeholder="E-mail"/>
<h:inputSecret styleClass="inputs" value="" f5:placeholder="Password"/>
<h:commandButton styleClass="lbutton" value="Login"/>
</h:form>
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,21 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f5="http://xmlns.jcp.org/jsf/passthrough">
<h:head>
<title>Login</title>
>
</h:head>
<h:body>
<ui:composition>
<h:form id="searchFormId">
<h:inputText styleClass="inputs" value="" f5:type="email" f5:placeholder="Search"/>
<h:commandButton styleClass="lbutton" value="Search!"/>
</h:form>
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,26 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<ui:fragment>
<p:panelGrid columns="3" >
<p:column >
<ui:include src="/matrices/matrixA.xhtml"/>
</p:column>
<p:column >
<ui:include src="/matrices/matrixB.xhtml"/>
</p:column>
<p:column >
<ui:include src="/matrices/matrixC.xhtml"/>
</p:column>
</p:panelGrid>
</ui:fragment>
</h:body>
</html>

View File

@@ -0,0 +1,51 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>MatriX A</title>
<h:outputStylesheet name="css/layout-css/dataTable.css" />
<h:outputScript library="js" name="do_validation.js"/>
</h:head>
<h:body>
<h:form id="form_matrix_A">
<p:tooltip globalSelector="true"/>
<p:growl id="id_messageA" showDetail="true"/>
<p:dataTable class="dataTables"
id="datatableA"
value="#{matrixOperations.getMatrixA().matrix}"
var="row"
rowIndexVar="i"
scrollable="true"
paginatorAlwaysVisible="true"
paginator="true"
paginatorPosition="top"
rows="10"
lazy="true" >
<f:facet name="header" > Matrix A </f:facet>
<p:columns
value="#{matrixOperations.getMatrixA().getMatrix().get(i)}"
var="arrayListElement" columnIndexVar="j">
<h:inputText
converterMessage="Invalid format!"
title= "(#{i},#{j})"
style="margin-left: 2px;" class="input"
value="#{row[i]}" >
<f:ajax event="keyup"
listener="#{matrixOperations.getMatrixA().listenForKeyUp(i,j, row[i] )}"
/>
</h:inputText>
</p:columns>
</p:dataTable>
</h:form>
</h:body>
</html>

View File

@@ -0,0 +1,48 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>MatriX A</title>
</h:head>
<h:body>
<h:form id="form_matrix_B">
<p:tooltip globalSelector="true"/>
<p:growl id="id_messageA" showDetail="true"/>
<p:dataTable class="dataTables"
id="datatableB"
value="#{matrixOperations.getMatrixB().matrix}"
var="row"
rowIndexVar="i"
scrollable="true"
paginatorAlwaysVisible="true"
paginator="true"
paginatorPosition="top"
rows="10"
lazy="true" >
<f:facet name="header" > Matrix B </f:facet>
<p:columns
value="#{matrixOperations.getMatrixB().getMatrix().get(i)}"
var="arrayListElement" columnIndexVar="j">
<h:inputText
converterMessage="Invalid format!"
title= "(#{i},#{j})"
style="margin-left: 2px;" class="input"
value="#{row[i]}" >
<f:ajax event="keyup"
listener="#{matrixOperations.getMatrixB().listenForKeyUp(i,j, row[i] )}"
/>
</h:inputText>
</p:columns>
</p:dataTable>
</h:form>
</h:body>
</html>

View File

@@ -0,0 +1,47 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>MAtrix C</title>
</h:head>
<h:body>
<h:form id="formC">
<p:tooltip globalSelector="true"/>
<p:growl id="id_messageA" showDetail="true"/>
<p:dataTable class="dataTables"
id="datatableC"
value="#{matrixOperations.getMatrixC().matrix}"
var="row"
rowIndexVar="i"
scrollable="true"
paginatorAlwaysVisible="true"
paginator="true"
paginatorPosition="top"
rows="10"
lazy="true" >
<f:facet name="header" > Matrix C </f:facet>
<p:columns id ="columnsC"
value="#{matrixOperations.getMatrixC().getMatrix().get(i)}"
var="arrayListElement" columnIndexVar="j">
<h:inputText id ="inputTextC"
converterMessage="Invalid format!"
title= "(#{i},#{j})"
style="margin-left: 2px;" class="input"
value="#{row[i]}" >
</h:inputText>
</p:columns>
</p:dataTable>
</h:form>
</h:body>
</html>

View File

@@ -0,0 +1,39 @@
<?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://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
<title>Menu</title>
</h:head>
<h:body>
<ui:fragment rendered="#{ isMenu eq 'true' ? true : false}">
<p:tooltip globalSelector="true"/>
<h:form id="form_menu">
<p:growl id="id_message" showDetail="true"/>
<p:menubar id="menuBar">
<p:submenu id ="submenu_matrices"
label="Matrix" icon="pi pi-table">
<p:menuitem title="This does addition"
id ="menuitem_add" value="Add" disabled="false"
action="#{menuBar.add()}"
icon="pi pi-plus" update="id_message "/>
<p:menuitem icon="pi pi-times" title="Multiplication"
id ="menuitem_multiply" value="Multiply"
disabled="false"
action="#{menuBar.multiply()}"
update="id_message"/>
<p:menuitem title="Subtraction" id ="menuitem_subtract" value="Subtract"
action="#{menuBar.subtract}" disabled="false"
icon="pi pi-minus" update="id_message"/>
</p:submenu>
</p:menubar>
</h:form>
</ui:fragment >
</h:body>
</html>

View File

@@ -0,0 +1,18 @@
#bottom {
margin: 0px 0px 0px 0px;
text-align:center;
color: #ffffff;
background-image: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, blue),
color-stop(1, blue)
);
background-image: -o-linear-gradient(bottom, blue 0%, #120205 100%);
background-image: -moz-linear-gradient(bottom, blue 0%, #120205 100%);
background-image: -webkit-linear-gradient(bottom, blue 0%, #120205 100%);
background-image: -ms-linear-gradient(bottom, blue 0%, #120205 100%);
background-image: linear-gradient(to bottom, blue 0%, #120205 100%);
}

View File

@@ -0,0 +1,3 @@
#content {
background: white;
}

View File

@@ -0,0 +1,50 @@
#wrapper {
margin-left:auto;
margin-right:auto;
}
#title {
position: relative;
margin: 1px 0px 0px 0px;
}
#login_and_search {
position: relative;
margin: 0px 0px 5px 0px;
}
#login {
float: left;
position: relative;
}
#search {
float: right;
position: relative;
}
#top {
position: relative;
overflow: hidden;
}
#bottom {
position: relative;
}
#left {
float: left;
}
#logo {
float: left;
}
#right {
float: right;
}
#content {
overflow: hidden;
}

View File

@@ -0,0 +1,237 @@
.rowNumber{
margin-right:20px;
width : 100px;
background: blue;
font-family: Impact;
font-size: 1.2em;
color: white;
}
body .ui-datatable .ui-paginator {
position: relative;
text-align: left;
bottom: 0px;
width: inherit;
padding: 2px;
z-index: 1;
}
.input {
font-size: 1em;
max-width: 35px;
min-width: 35px;
height : 35px;
font-size: 1em;
font-family: inherit;
background-color: #fff;
border: solid 1px;
border-color: blueviolet;
border-radius: 4px;
}
.dataTables {
overflow-y:scroll;
overflow-x:scroll;
height : 386px;
width: 300px;
display:block;
background-color: #fff;
zoom: 1;
}
.ui-datatable table{
border-collapse:collapse;
width:100%;
}
.ui-datatable.ui-datatable-header,.ui-datatable.ui-datatable-footer{
text-align:center;
padding:4px 10px;
}
.ui-datatable.ui-datatable-header{
border-bottom:0px none;
}
.ui-datatable.ui-datatable-footer{
border-top:0px none;
}
.ui-datatable thead th
{
font-family: Arial;
font-size: 1.2em;
color: blue;
background: white;
}
.ui-datatable thead td
{
font-family: Impact;
font-size:1.2em;
color: blue;
}
.ui-datatable tfoot td{
text-align:center;
}
ui-datatable thead th
{
overflow:hidden;
}
.ui-datatable tbody td , .ui-datatable tfoot td{
padding:4px 10px;
overflow:hidden;
white-space:nowrap;
border-width:1px;
border-style:solid;
}
.ui-datatable tbody tr
{
clear: both;
}
.ui-datatable .ui-sortable-column{
cursor:pointer;
}
.ui-datatable div.ui-dt-c{
position:relative;
}
.ui-datatable .ui-sortable-column-icon{
display:inline-block;
margin:-3px 0px -3px 2px;
}
.ui-datatable .ui-column-filter{
display:block;
width:100px;
margin:auto;
}
.ui-datatable .ui-expanded-row{
border-bottom:0px none;
}
.ui-datatable .ui-expanded-row-content{
border-top:0px none;
}
.ui-datatable .ui-row-toggler{
cursor:pointer;
}
.ui-datatable tr.ui-state-highlight{
cursor:pointer;
}
.ui-datatable .ui-selection-column .ui-chkbox-all{
display:block;
margin:0px auto;
width:16px;
height:16px;
}
.ui-datatable-scrollable table{
table-layout:auto;
}
.ui-datatable-scrollable-body{
overflow:auto;
}
.ui-datatable-scrollable-header,.ui-datatable-scrollable-footer{
overflow:hidden;
border:0px none;
}
.ui-datatable-scrollable .ui-datatable-scrollable-header,.ui-datatable-scrollable .ui-datatable-scrollable-footer{
position:relative;
}
.ui-datatable-scrollable .ui-datatable-scrollable-header td{
font-weight:normal;
}
.ui-datatable-scrollable-body::-webkit-scrollbar{
-webkit-appearance:none;
width:15px;
background-color:transparent;
}
.ui-datatable-scrollable-body::-webkit-scrollbar-thumb{
border-radius:8px;
border:1px solid white;
background-color:rgba(194,194,194,.5);
}
.ui-datatable .ui-datatable-data tr.ui-state-hover{
border-color:inherit;
font-weight:inherit;
cursor:pointer;
}
.ui-datatable .ui-paginator,.ui-datatable .ui-paginator{
padding:2px;
}
.ui-column-dnd-top, ui-column-dnd-bottom{
display:none;
position:absolute;
}
.ui-column-dnd-top .ui-icon, ui-column-dnd-bottom .ui-icon{
position:absolute;
top:-4px;
}
/* InCell Editing */.ui-datatable .ui-cell-editor-input{
display:none;
}
.ui-datatable .ui-row-editing .ui-cell-editor .ui-cell-editor-output{
display:none;
}
.ui-datatable .ui-row-editing .ui-cell-editor .ui-cell-editor-input{
display:block;
}
.ui-datatable .ui-row-editor span{
cursor:pointer;
display:inline-block;
}
.ui-datatable .ui-row-editor .ui-icon-pencil{
display:inline-block;
}
.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-pencil{
display:none;
}
.ui-datatable .ui-row-editor .ui-icon-check,.ui-datatable .ui-row-editor .ui-icon-close{
display:none;
}
.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-check,.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-close{
display:inline-block;
}
.ui-datatable .ui-datatable-data tr.ui-row-editing td.ui-editable-column,.ui-datatable .ui-datatable-data td.ui-cell-editing{
padding:0;
margin:0;
}
/*resizer */.ui-datatable .ui-column-resizer{
width:8px;
height:20px;
padding:0px;
cursor:col-resize;
background-image:url("/ScraperOnWeb/javax.faces.resource/spacer/dot_clear.gif.jsf?ln=primefaces");
margin:-4px -10px -4px 0px;
float:right;
}
.ui-datatable .ui-filter-column .ui-column-resizer{
height:45px;
}
.ui-datatable .ui-column-resizer-helper{
width:1px;
position:absolute;
z-index:10;
display:none;
}
.ui-datatable-resizable{
padding-bottom:1px;/*fix for webkit overlow*/
overflow:auto;
}
.ui-datatable-resizable table{
table-layout:auto;
}
.ui-datatable-rtl{
direction:rtl;
}
.ui-datatable-rtl.ui-datatable thead th, .ui-datatable-rtl.ui-datatable tfoot td{
text-align:right;
}

View File

@@ -0,0 +1,8 @@
body {
background-color: #ffffff;
font-size: 12px;
font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;
color: #000000;
margin: 2px;
}

View File

@@ -0,0 +1,34 @@
* {box-sizing: border-box;}
.img-zoom-container {
position: relative;
}
.img-zoom-lens {
position: absolute;
/*set the size of the lens:*/
width: 40px;
height: 40px;
}
.img-zoom-result {
/*border: 5px solid #000000;*/
/*set the size of the result div:*/
width: 300px;
height: 300px;
}
.myDiv
{
align: center;
padding: 30px;
margin: 10;
border-left: 10px solid navy;
}
.hpanel{
position: relative;
top: 0px; left: 0px;
}

View File

@@ -0,0 +1,22 @@
#left {
background-image: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, #2D4A37),
color-stop(1, #789480)
);
background-image: -o-linear-gradient(bottom, #2D4A37 0%, #789480 100%);
background-image: -moz-linear-gradient(bottom, #2D4A37 0%, #789480 100%);
background-image: -webkit-linear-gradient(bottom, #2D4A37 0%, #789480 100%);
background-image: -ms-linear-gradient(bottom, #2D4A37 0%, #789480 100%);
background-image: linear-gradient(to bottom, #2D4A37 0%, #789480 100%);
-moz-box-shadow: 0px 0px 15px 3px #333333;
-webkit-box-shadow: 0px 0px 15px 3px #333333;
box-shadow: 0px 0px 15px 3px #333333;
text-align:left;
padding-left:10px;
margin-right: 5px;
}

View File

@@ -0,0 +1,65 @@
.inputs {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: #00f;
background: -moz-linear-gradient(top, #FFF, #EAEAEA);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #FFF), color-stop(1.0, #EAEAEA));
border: 1px solid #CACACA;
color: #444;
font-size: 1.1em;
margin: 0px 10px 0px 0px;
padding-left: 2px;
width:200px;
}
.inputs:focus {
color: #ffffff;
background: #0000cc;
-webkit-box-shadow: 0 0 25px #CCC;
-moz-box-shadow: 0 0 25px #cccc00;
box-shadow: 0 0 25px #CCCC00;
-webkit-transform: scale(1.05);
-moz-transform: scale(1.05);
transform: scale(1.05);
}
.lbutton {
-moz-box-shadow: 4px 7px 13px -7px #276873;
-webkit-box-shadow: 4px 7px 13px -7px #276873;
box-shadow: 4px 7px 13px -7px #276873;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #171717), color-stop(1, #d92323));
background:-moz-linear-gradient(top, #171717 5%, #222 100%);
background:-webkit-linear-gradient(top, #171717 5%, #222 100%);
background:-o-linear-gradient(top, #171717 5%, #222 100%);
background:-ms-linear-gradient(top, #171717 5%, #222 100%);
background:linear-gradient(to bottom, #171717 5%, #222 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#171717', endColorstr='#d92323',GradientType=0);
background-color:#222;
-moz-border-radius:17px;
-webkit-border-radius:17px;
border-radius:17px;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:arial;
font-size:12px;
font-weight:bold;
padding:2px 12px;
text-decoration:none;
text-shadow:0px 1px 0px #3d768a;
}
.lbutton:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #222), color-stop(1, #171717));
background:-moz-linear-gradient(top, #00f 5%, #222 100%);
background:-webkit-linear-gradient(top, 00f 5%, #222 100%);
background:-o-linear-gradient(top, #00f 5%, #222 100%);
background:-ms-linear-gradient(top, #00f 5%, #222 100%);
background:linear-gradient(to bottom, #00f 5%, #222 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d92323', endColorstr='#222',GradientType=0);
background-color:#00f;
}
.lbutton:active {
position:relative;
top:1px;
}

View File

@@ -0,0 +1,8 @@
#login_and_search {
width:100%;
height:90px;
background-color: white;
padding: 20px;
display: inline-block;
}

View File

@@ -0,0 +1,9 @@
#logo {
background-image : url("#{resource['images/owl.png']}") ;
background-repeat: no-repeat;
margin-right: 0px;
width:60px;
height:60px;
float: left;
}

View File

@@ -0,0 +1,37 @@
#menu {
white-space: nowrap;
height: 28px;
width:100%;
background: #fff url("#{resource['images/menu.png']}") bottom center ;
margin-bottom: 5px;
}
#menu ul {
margin: 0;
padding: 0;
list-style:none;
float:left;
}
#menu li {
float: left;
margin: 0 3px 0 3px;
padding: 0;
background: transparent;
}
#menu a {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: normal;
float:left;
display:block;
height: 26px;
line-height: 24px;
padding: 2px 10px 0 10px;
color: #cccc00;
text-decoration: none;
background: transparent;
}

View File

@@ -0,0 +1,5 @@
#right {
background-color: #FA0519;
text-align:center;
margin-left: 5px;
}

View File

@@ -0,0 +1,3 @@
#search {
color: #ffffff;
}

View File

@@ -0,0 +1,67 @@
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: normal;
float:left;
display:block;
height: 26px;
line-height: 24px;
padding: 2px 10px 0 10px;
color: #cccc00;
text-decoration:#A3979A;
background-color: white;
border: white;
padding: 0px
}
a.hover {
float: left;
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: normal;
float:left;
display:block;
height: 26px;
line-height: 24px;
color: #cccc00;
text-decoration: none;
background-color: white;
border: white;
padding: 0px
}
.menus
{
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: normal;
float:right;
color: #cccc00;
text-decoration:#A3979A;
background-color: white;
border: white;
padding: 0px ;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
}
.affaires .ui-menuitem-text{color:#cccc00;
decoration: bold, italic;
}
.affaires .ui-menu-child{background: white; mouseover: #000;
background-color: #A80000;}
.affaires .ui-menubar{mouseover: #000;
background-color: #A80000;}
.affaires .ui-state-hover {}
a.active {
color: #D09d23;
font-weight: bold;
background-color : #c7c3c3;
}

View File

@@ -0,0 +1,9 @@
#title {
background: white;
color:blue;
text-align:center;
font-size: 24px;
font-weight: bold;
}

View File

@@ -0,0 +1,9 @@
#top {
color: blue;
font-family: cursive, sans-serif;
font-size: 22px;
font-style: italic;
text-align: center;
height:60px;
background: white;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -0,0 +1,22 @@
function validateText(textInputID)
{
var htmlInputText = document.getElementById(textInputID);
var text = htmlInputText.value;
var regex = /[^A-Za-z0-9]/g;
if (text.search( regex) != -1)
{
newText = text.replace(regex, "");
htmlInputText.value = newText;
//alert("alphanumeric chars only please");
}
}

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition >
<h1>This is default footer</h1>
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
This is default content
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
This is default left side
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
Default Login Section
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
LOGO
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,14 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<h:body>
<ui:composition>
Menu default
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
This is default right side
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
Default Search Section
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
This is default title
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,12 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<ui:composition>
<h1>This is default header</h1>
</ui:composition>
</h:body>
</html>

View File

@@ -0,0 +1,115 @@
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h:outputStylesheet name="#{title eq false ? 'css/layout-css/default.css' : 'css/layout-css/titleStyle.css'}"/>
<h:outputStylesheet name="#{loginsearch eq false ? 'css/layout-css/default.css' : 'css/layout-css/login_and_searchStyle.css'}"/>
<h:outputStylesheet name="#{top eq false ? 'css/layout-css/default.css' : 'css/layout-css/topStyle.css'}"/>
<h:outputStylesheet name="#{bottom eq true ? 'css/layout-css/default.css' : 'css/layout-css/bottomStyle.css'}"/>
<h:outputStylesheet name="#{left eq false ? 'css/layout-css/default.css' : 'css/layout-css/stylesLinks.css'}"/>
<h:outputStylesheet name="#{right eq false ? 'css/layout-css/default.css' : 'css/layout-css/rightStyle.css'}"/>
<h:outputStylesheet name="#{content eq false ? 'css/layout-css/default.css' : 'css/layout-css/dataTable.css'}"/>
<h:outputStylesheet name="#{login eq false ? 'css/layout-css/default.css' : 'css/layout-css/loginStyle.css'}"/>
<h:outputStylesheet name="#{login_and_search eq false ? 'css/layout-css/default.css' : 'css/layout-css/login_and_searchStyle.css'}"/>
<h:outputStylesheet name="#{search eq false ? 'css/layout-css/default.css' : 'css/layout-css/searchStyle.css'}"/>
<h:outputStylesheet name="#{menu eq false ? 'css/layout-css/default.css' : 'css/layout-css/menuStyle.css'}"/>
<h:outputStylesheet name="#{logo eq false ? 'css/layout-css/default.css' : 'css/layout-css/logoStyle.css'}"/>
<title>Generic Template</title>
</h:head>
<h:body>
<div id="wrapper"
style="margin:auto; width: #{empty wrapperWidth ? '100%' : wrapperWidth}">
<ui:fragment rendered="#{empty title ? true : title}">
<div id="title"> <!-- div is needed to associate this div with css for title -->
<ui:insert name="title">
<ui:include src="/resources/default/titleDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty top ? true : top}">
<div id="logo_and_top" style="overflow:auto;">
<ui:fragment rendered="#{empty logo ? true : logo}">
<div id="logo">
<ui:insert name="logo">
<ui:include src="/resources/templates/default/logoDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
<div id="top">
<ui:insert name="top">
<ui:include src="/resources/templates/default/topDefault.xhtml" />
</ui:insert>
</div>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty loginsearch ? true : loginsearch}">
<div id="login_and_search"> <!-- div is needed for css -->
<ui:fragment rendered="#{empty login ? true : login}">
<div id="login">
<ui:insert name="login">
<ui:include src="/resources/templates/default/loginDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty search ? true : search}">
<div id="search">
<ui:insert name="search">
<ui:include src="/resources/templates/default/searchDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty menu ? true : menu}">
<div id="menu">
<ui:insert name="menu">
<ui:include src="/resources/templates/default/menuDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
<div id="main" style="overflow:auto;">
<ui:fragment rendered="#{empty left ? true : left}">
<div id="left"
style="width: #{empty leftWidth ? '150px' : leftWidth}">
<ui:insert name="left">
<ui:include src="/resources/templates/default/leftDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty right ? true : right}">
<div id="right" style="width: #{empty rightWidth ? '150px' : rightWidth}">
<ui:insert name="right">
<ui:include src="/resources/templates/default/rightDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty content ? true : content}">
<div id="content">
<ui:insert name="content">
<ui:include src="/resources/templates/default/contentDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
</div>
<ui:fragment rendered="#{empty bottom ? true : bottom}">
<div id="bottom">
<ui:insert name="bottom">
<ui:include src="/resources/templates/default/bottomDefault.xhtml" />
</ui:insert>
</div>
</ui:fragment>
</div>
</h:body>
</html>