Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
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 3f397436
authored
May 12, 2017
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
virpest fixed and some minor changes to stuff
1 parent
fb3c09f4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
18 deletions
code/moya-angular/src/app/app.component.css
code/moya-angular/src/app/app.component.html
code/moya-angular/src/app/app.module.ts
code/moya-angular/src/app/old-moya/old-moya.component.ts
code/moya-web/WebContent/resources/templates/nglayout/template.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/rest/v2/VipRestView.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/v3/VipRestViewV3.java
code/moya-angular/src/app/app.component.css
View file @
3f39743
nav
a
.active
{
color
:
red
;
}
code/moya-angular/src/app/app.component.html
View file @
3f39743
<a
routerLink=
"/old"
routerLinkActive=
"active"
>
DeOldie
</a>
<nav>
<a
routerLink=
"/test"
routerLinkActive=
"active"
>
test
</a>
<a
routerLink=
"/vip/viplist"
routerLinkActive=
"active"
>
viplist
</a><br
/>
<a
routerLink=
"/vip/viplist"
routerLinkActive=
"active"
>
viplist
</a>
<a
routerLink=
"/old"
[
queryParams
]="{
p:
'
poll
/
index
.
jsf
'}"
routerLinkActive=
"active"
>
POLL
</a>
<a
routerLink=
"/old"
[
queryParams
]="{
p:
'
foodmanager
/
listFoodwaves
.
jsf
'}"
routerLinkActive=
"active"
>
foodWaves
</a>
</nav>
<br
/>
<router-outlet></router-outlet>
code/moya-angular/src/app/app.module.ts
View file @
3f39743
...
...
@@ -16,7 +16,7 @@ import {SafePipe } from './safe.pipe';
const
appRoutes
:
Routes
=
[
{
path
:
'vip/viplist'
,
component
:
ViplistComponent
},
{
path
:
'test'
,
component
:
TestComponent
},
{
path
:
'old'
,
component
:
OldMoyaComponent
}
{
path
:
'old'
,
pathMatch
:
'prefix'
,
component
:
OldMoyaComponent
}
];
...
...
code/moya-angular/src/app/old-moya/old-moya.component.ts
View file @
3f39743
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
}
from
'@angular/core'
;
import
{
Location
,
LocationStrategy
,
HashLocationStrategy
,
PathLocationStrategy
}
from
"@angular/common"
;
import
{
NavigationExtras
,
ActivatedRoute
}
from
"@angular/router"
;
import
{
Observable
}
from
"rxjs"
;
@
Component
({
selector
:
'app-old-moya'
,
...
...
@@ -11,30 +13,35 @@ export class OldMoyaComponent implements OnInit {
frameUrl
:
String
=
"/MoyaWeb/"
;
@
ViewChild
(
'iframe'
)
iframe
:
any
;
height
:
string
=
"1000px"
;
constructor
(
private
location
:
Location
)
{
constructor
(
private
location
:
Location
,
private
route
:
ActivatedRoute
)
{
let
tmpUrl
=
this
.
location
.
path
(
true
).
split
(
"#"
,
2
);
if
(
tmpUrl
.
length
>
1
)
{
this
.
frameUrl
=
"/MoyaWeb/"
+
tmpUrl
[
1
];
}
route
.
queryParamMap
.
map
(
a
=>
a
.
get
(
"p"
)).
subscribe
(
x
=>
{
if
(
x
)
{
this
.
frameUrl
=
"/MoyaWeb/"
+
x
;
}
}
);
}
ngOnInit
()
{
}
ngOnInit
()
{
}
changeUrl
()
{
let
tmpUrl
=
this
.
iframe
.
nativeElement
.
contentWindow
.
location
.
href
.
split
(
"/MoyaWeb/"
,
2
);
if
(
tmpUrl
.
length
>
1
)
{
this
.
location
.
replaceState
(
this
.
location
.
path
(
false
)
+
"#
"
+
tmpUrl
[
1
]);
this
.
location
.
replaceState
(
"/old?p=
"
+
tmpUrl
[
1
]);
}
this
.
height
=
this
.
iframe
.
nativeElement
.
contentWindow
.
document
.
body
.
scrollHeight
+
"px"
;
}
...
...
code/moya-web/WebContent/resources/templates/nglayout/template.xhtml
View file @
3f39743
...
...
@@ -183,7 +183,7 @@
var
realUrl
=
"/MoyaNG/old"
;
if
(
url
.
length
>
1
)
{
realUrl
=
"/MoyaNG/old
#
"
+
url
[
1
];
realUrl
=
"/MoyaNG/old
?p=
"
+
url
[
1
];
}
document
.
location
.
href
=
realUrl
;
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/v2/VipRestView.java
View file @
3f39743
...
...
@@ -2,6 +2,7 @@ package fi.codecrew.moya.rest.v2;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
...
...
@@ -12,6 +13,7 @@ import javax.ws.rs.POST;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.GenericEntity
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
...
...
@@ -51,7 +53,7 @@ public class VipRestView {
@Path
(
"/all"
)
public
Response
getAllVips
()
{
ArrayList
<
VipRestPojo
>
ret
=
VipRestPojo
.
create
(
vipbean
.
getAvailableVips
());
return
Response
.
ok
(
ret
).
build
();
return
Response
.
ok
(
new
GenericEntity
<
List
<
VipRestPojo
>>(
ret
)
{}
).
build
();
}
@GET
...
...
@@ -62,7 +64,7 @@ public class VipRestView {
sq
.
setPagesize
(
0
);
SearchResult
<
Vip
>
result
=
vipbean
.
search
(
sq
);
ArrayList
<
VipRestPojo
>
ret
=
VipRestPojo
.
create
(
result
.
getResults
());
return
Response
.
ok
(
ret
).
build
();
return
Response
.
ok
(
new
GenericEntity
<
List
<
VipRestPojo
>>(
ret
)
{}
).
build
();
}
@DELETE
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/v3/VipRestViewV3.java
View file @
3f39743
...
...
@@ -16,10 +16,12 @@ import io.swagger.annotations.Api;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.ws.rs.*
;
import
javax.ws.rs.core.GenericEntity
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -47,7 +49,7 @@ public class VipRestViewV3 {
@Path
(
"/all"
)
public
Response
getAllVips
()
{
ArrayList
<
VipRestPojoV3
>
ret
=
VipRestPojoV3
.
create
(
vipbean
.
getAvailableVips
());
return
Response
.
ok
(
ret
).
build
();
return
Response
.
ok
(
new
GenericEntity
<
List
<
VipRestPojoV3
>>(
ret
)
{}
).
build
();
}
@GET
...
...
@@ -58,7 +60,7 @@ public class VipRestViewV3 {
sq
.
setPagesize
(
0
);
SearchResult
<
Vip
>
result
=
vipbean
.
search
(
sq
);
ArrayList
<
VipRestPojoV3
>
ret
=
VipRestPojoV3
.
create
(
result
.
getResults
());
return
Response
.
ok
(
ret
).
build
();
return
Response
.
ok
(
new
GenericEntity
<
List
<
VipRestPojoV3
>>(
ret
)
{}
).
build
();
}
@DELETE
...
...
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