Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
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 0bafdf4c
authored
Apr 25, 2010
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added beans projec library dependencies .classpath file.
1 parent
074aa366
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
1 deletions
code/Autentikaation asennus glassfishiin.
code/LanBortalBeans/.classpath
code/LanBortalUtilities/src/fi/insomnia/bortal/utilities/BillUtils.java
code/Autentikaation asennus glassfishiin.
View file @
0bafdf4
...
...
@@ -2,7 +2,7 @@ bortal realmin lisääminen glassfishiin.
1. Lisää code/LanBortalAuthModule.jar tiedosto hakemistoon glassfish/glassfish/lib/
2. lisää tiedostoon glassfish/glassfish/domains/
domain1/config/
login.conf tiedostoon:
2. lisää tiedostoon glassfish/glassfish/domains/login.conf tiedostoon:
bortalRealm {
fi.insomnia.bortal.BortalLoginModule required;
...
...
@@ -11,3 +11,6 @@ bortalRealm {
3. suorita seuraava komento hakemistossa glassfish/glassfish/bin/
./asadmin create-auth-realm --classname fi.insomnia.bortal.BortalRealm --property jaas-context=bortalRealm omniarealm
./asadmin create-jdbc-connection-pool --datasourceclassname org.postgresql.ds.PGSimpleDataSource --restype javax.sql.DataSource --ping true --property DatabaseName=BortalDb:Password=derkoppa:User=bortal Omniapossu
\ No newline at end of file
code/LanBortalBeans/.classpath
View file @
0bafdf4
...
...
@@ -12,5 +12,6 @@
<attribute
name=
"owner.project.facets"
value=
"jst.java"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"lib"
path=
"libs/PDFjet.jar"
/>
<classpathentry
kind=
"output"
path=
"build/classes"
/>
</classpath>
code/LanBortalUtilities/src/fi/insomnia/bortal/utilities/BillUtils.java
0 → 100644
View file @
0bafdf4
package
fi
.
insomnia
.
bortal
.
utilities
;
public
class
BillUtils
{
private
static
final
int
[]
multipliers
=
new
int
[]
{
7
,
3
,
1
};
/**
* Calculates and return the reference number calculated from the given base
* @param base
* @return
*/
public
static
Integer
createReferenceNumber
(
Integer
base
)
{
return
base
*
10
+
calculateChecksum
(
base
);
}
/**
* This function will calculate the checksum for the bills checksum
* nuber for the given checksum base
* @param base Thebase of the checksum
* @return checksum integer in the range of 0-9 calculated from the given base
*/
public
static
Integer
calculateChecksum
(
Integer
base
)
{
int
checksum
=
0
;
for
(
int
i
=
0
;
base
>
0
;
i
=
(
i
>=
multipliers
.
length
?
0
:
i
+
1
))
{
int
num
=
base
%
10
;
checksum
+=
multipliers
[
i
]
*
num
;
base
=
base
/
10
;
}
return
(
checksum
%
10
==
0
?
0
:
10
-
(
checksum
%
10
));
}
}
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