Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 22ff156f
authored
Mar 07, 2010
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lisätty siistimpi tilapäinen ulkoasu.
1 parent
57f87311
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
129 additions
and
88 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/UserBean.java
code/LanBortalWeb/WebContent/WEB-INF/faces-config.xml
code/LanBortalWeb/WebContent/helloWorld.xhtml
code/LanBortalWeb/WebContent/layout/default-template.xhtml
code/LanBortalWeb/build/classes/fi/insomnia/bortal/view/UserView.class
code/LanBortalWeb/src/fi/insomnia/bortal/view/UserView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/UserBean.java
View file @
22ff156
...
...
@@ -18,7 +18,7 @@ import fi.insomnia.bortal.model.User;
*/
@LocalBean
@Stateless
public
class
UserBean
extends
Generiimplements
UserBeanLocal
{
public
class
UserBean
extends
Generi
c
implements
UserBeanLocal
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UserBean
.
class
);
/**
...
...
code/LanBortalWeb/WebContent/WEB-INF/faces-config.xml
View file @
22ff156
<?xml version="1.0"?>
<faces-config
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
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-facesconfig_2_0.xsd"
version=
"2.0"
>
<application>
<resource-bundle>
<base-name>
web.messages
</base-name>
<var>
msgs
</var>
</resource-bundle>
</application>
version=
"2.0"
>
<application>
<resource-bundle>
<base-name>
resources.i18n
</base-name>
<var>
i18n
</var>
</resource-bundle>
<message-bundle>
i18n
</message-bundle>
<!-- Legal Country codes: http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm -->
<!-- Assigned Country codes: -->
<!-- Insomnia: IN (INDIA) -->
<!-- Stream: ST (SAO TOME AND PRINCIPE ) -->
<!-- Vector VE (VENEZUELA, BOLIVARIAN REPUBLIC OF) -->
<locale-config>
<default-locale>
fi
</default-locale>
<supported-locale>
fi_IN_XII
</supported-locale>
<supported-locale>
en_ST_v7
</supported-locale>
</locale-config>
</application>
</faces-config>
code/LanBortalWeb/WebContent/helloWorld.xhtml
View file @
22ff156
<!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://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
>
<h:head>
<title></title>
</h:head>
<h:body>
<ui:composition
template=
"/layout/default-template.xhtml"
>
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
>
<h:head>
<title></title>
</h:head>
<h:body>
<ui:composition
template=
"/layout/default-template.xhtml"
>
<ui:define
name=
"title"
>
HelloWorld
</ui:define>
<ui:define
name=
"header"
>
Header
</ui:define>
<ui:define
name=
"content"
>
Hello Message:
<i>
${helloWorld.hello}
</i>
<h:form>
<h:inputText
value=
"#{helloWorld.name}"
/>
<h:commandButton
action=
"helloPage"
value=
"Say hello"
/>
</h:form>
<h:form>
So far said hello to the following people
<h:dataTable
id=
"dt1"
value=
"#{helloWorld.helloedPeople}"
var=
"item"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"id"
/>
</f:facet>
<h:outputText
value=
"#{item.id}"
></h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"name"
/>
</f:facet>
<h:commandLink
action=
"#{helloWorld.getDetail}"
value=
"#{item.name}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"saved"
/>
</f:facet>
<h:outputText
value=
"#{item.saved}"
>
<f:convertDateTime
pattern=
"dd.MM.yyyy hh:mm"
/>
</h:outputText>
</h:column>
</h:dataTable>
</h:form>
Foo #{i18n.teststr }
fallback #{i18n.fallbackstr }
</ui:define>
<ui:define
name=
"footer"
>
footer
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/layout/default-template.xhtml
View file @
22ff156
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
>
<head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.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"
>
<f:view
locale=
"#{userView.locale}"
>
<h:head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
<title><ui:insert
name=
"title"
>
Default title
</ui:insert></title>
</head>
<body>
<div
id=
"header"
>
<ui:insert
name=
"header"
>
Header area. See comments below this line in the source.
<!-- include your header file or uncomment the include below and create header.xhtml in this directory -->
<!-- <ui:include src="header.xhtml"/> -->
</ui:insert>
</div>
<!-- **** layout stylesheet **** -->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"#{request.contextPath}/resources/style/style.css"
/>
<div
id=
"content"
>
<ui:insert
name=
"content"
>
Content area. See comments below this line in the source.
<!-- include your content file or uncomment the include below and create content.xhtml in this directory -->
<!-- <div> -->
<!-- <ui:include src="content.xhtml"/> -->
<!-- </div> -->
</ui:insert>
</div>
<div
id=
"footer"
>
<ui:insert
name=
"footer"
>
Footer area. See comments below this line in the source.
<!-- include your header file or uncomment the include below and create footer.xhtml in this directory -->
<!--<ui:include src="footer.xhtml"/> -->
</ui:insert>
</div>
</body>
<!-- **** colour scheme stylesheet **** -->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"#{request.contextPath}/resources/style/green.css"
/>
</h:head>
<h:body>
<div
id=
"main"
>
<div
id=
"links"
>
<!-- **** INSERT LINKS HERE **** -->
<ui:insert
name=
"somelinks"
>
<a
href=
"http://www.insomnia.fi"
>
www.insomnia.fi
</a>
</ui:insert>
</div>
<div
id=
"logo"
><h1><ui:insert
name=
"globaltitle"
>
Y
<span>
ks
</span>
P
<span>
ikku
</span>
J
<span>
uttu
</span></ui:insert></h1></div>
<div
id=
"menu"
>
<ui:insert
name=
"toplinks"
><ui:include
src=
"/layout/toplinks.xhtml"
/></ui:insert>
</div>
<div
id=
"content"
>
<div
id=
"column1"
>
<div
class=
"sidebaritem"
>
<div
class=
"sbihead"
>
<h1>
additional links
</h1>
</div>
<div
class=
"sbilinks"
>
<!-- **** INSERT ADDITIONAL LINKS HERE **** -->
<ui:insert
name=
"sidelinks"
>
<ul>
<li><a
href=
"http://www.openwebdesign.org"
>
open web design
</a></li>
<li><a
href=
"http://www.w3schools.com/xhtml/default.asp"
>
learn XHTML
</a></li>
<li><a
href=
"http://www.w3schools.com/css/default.asp"
>
learn CSS
</a></li>
<li><a
href=
"http://www.mozilla.com/firefox"
>
get firefox
</a></li>
</ul>
</ui:insert>
</div>
</div>
<div
class=
"sidebaritem"
>
<div
class=
"sbihead"
>
<h1>
latest news
</h1>
</div>
<div
class=
"sbicontent"
>
<!-- **** INSERT NEWS ITEMS HERE **** -->
<h2>
01.09.2006
</h2>
<p>
This is where you can put your latest news.
</p>
<p><a
href=
"#"
>
read more ...
</a></p>
<p></p>
<p></p>
<h2>
01.09.2006
</h2>
<p>
This is where you can put your latest news.
</p>
<p><a
href=
"#"
>
read more ...
</a></p>
</div>
</div>
<div
class=
"sidebaritem"
>
<div
class=
"sbihead"
>
<h1>
other information
</h1>
</div>
<div
class=
"sbicontent"
>
<!-- **** INSERT OTHER INFORMATION HERE **** -->
<p>
This space can be used for additional information such as a contact phone number, address
or maybe even a graphic.
</p>
</div>
</div>
</div>
<div
id=
"column2"
>
<h:messages
globalOnly=
"true"
/>
<ui:insert
name=
"content"
>
Default content..
</ui:insert>
</div>
</div>
<div
id=
"footer"
>
copyright
©
Insomnia Ry, Stream Ry, Vector Ry |
<a
href=
"#"
>
email@emailaddress
</a>
|
<a
href=
"http://validator.w3.org/check?uri=referer"
>
XHTML 1.1
</a>
|
<a
href=
"http://jigsaw.w3.org/css-validator/check/referer"
>
CSS
</a>
|
<a
href=
"http://www.dcarter.co.uk"
>
design by dcarter
</a>
</div>
</div>
</h:body>
</f:view>
</html>
\ No newline at end of file
code/LanBortalWeb/build/classes/fi/insomnia/bortal/view/UserView.class
View file @
22ff156
No preview for this file type
code/LanBortalWeb/src/fi/insomnia/bortal/view/UserView.java
View file @
22ff156
...
...
@@ -20,8 +20,7 @@ public class UserView {
@EJB
private
UserBeanLocal
userBean
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UserView
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UserView
.
class
);
private
User
user
;
...
...
@@ -35,9 +34,15 @@ public class UserView {
setUser
(
items
.
getRowData
());
return
"edit"
;
}
public
String
getLocale
()
{
return
"en_IN_XII"
;
}
public
String
createUser
()
{
logger
.
info
(
"Saving user"
);
logger
.
debug
(
"Saving user"
);
// Luodaan uusi k�ytt�j� UserBeanin funktiolla createNewUser jolle
// annetaan parametrina pakolliset tiedot ( nick ja salasana )
// Paluuarvona saadaan uusi uljas k�ytt�j�-olio.
...
...
@@ -61,7 +66,9 @@ public class UserView {
List
<
User
>
users
=
userBean
.
getUsers
();
items
=
new
ListDataModel
<
User
>(
users
);
logger
.
info
(
"Fetching users. Found {}"
,
items
.
getRowCount
());
return
items
;
}
// Getters and setters...
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment