Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 f0306ea8
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
8c92f8dd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
16 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 @
f0306ea
nav
a
.active
{
color
:
red
;
}
code/moya-angular/src/app/app.component.html
View file @
f0306ea
<nav>
<a
routerLink=
"/old"
routerLinkActive=
"active"
>
DeOldie
</a>
<a
routerLink=
"/test"
routerLinkActive=
"active"
>
test
</a>
<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>
<router-outlet></router-outlet>
code/moya-angular/src/app/app.module.ts
View file @
f0306ea
...
@@ -16,7 +16,7 @@ import {SafePipe } from './safe.pipe';
...
@@ -16,7 +16,7 @@ import {SafePipe } from './safe.pipe';
const
appRoutes
:
Routes
=
[
const
appRoutes
:
Routes
=
[
{
path
:
'vip/viplist'
,
component
:
ViplistComponent
},
{
path
:
'vip/viplist'
,
component
:
ViplistComponent
},
{
path
:
'test'
,
component
:
TestComponent
},
{
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 @
f0306ea
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
}
from
'@angular/core'
;
import
{
Location
,
LocationStrategy
,
HashLocationStrategy
,
PathLocationStrategy
}
from
"@angular/common"
;
import
{
Location
,
LocationStrategy
,
HashLocationStrategy
,
PathLocationStrategy
}
from
"@angular/common"
;
import
{
NavigationExtras
,
ActivatedRoute
}
from
"@angular/router"
;
import
{
Observable
}
from
"rxjs"
;
@
Component
({
@
Component
({
selector
:
'app-old-moya'
,
selector
:
'app-old-moya'
,
...
@@ -11,30 +13,35 @@ export class OldMoyaComponent implements OnInit {
...
@@ -11,30 +13,35 @@ export class OldMoyaComponent implements OnInit {
frameUrl
:
String
=
"/MoyaWeb/"
;
frameUrl
:
String
=
"/MoyaWeb/"
;
@
ViewChild
(
'iframe'
)
iframe
:
any
;
@
ViewChild
(
'iframe'
)
iframe
:
any
;
height
:
string
=
"1000px"
;
height
:
string
=
"1000px"
;
constructor
(
private
location
:
Location
)
{
constructor
(
private
location
:
Location
,
private
route
:
ActivatedRoute
)
{
let
tmpUrl
=
this
.
location
.
path
(
true
).
split
(
"#"
,
2
);
route
.
queryParamMap
.
map
(
a
=>
a
.
get
(
"p"
)).
subscribe
(
x
=>
{
if
(
x
)
{
if
(
tmpUrl
.
length
>
1
)
{
this
.
frameUrl
=
"/MoyaWeb/"
+
x
;
this
.
frameUrl
=
"/MoyaWeb/"
+
tmpUrl
[
1
];
}
}
}
);
}
}
ngOnInit
()
{
}
ngOnInit
()
{
}
changeUrl
()
{
changeUrl
()
{
let
tmpUrl
=
this
.
iframe
.
nativeElement
.
contentWindow
.
location
.
href
.
split
(
"/MoyaWeb/"
,
2
);
let
tmpUrl
=
this
.
iframe
.
nativeElement
.
contentWindow
.
location
.
href
.
split
(
"/MoyaWeb/"
,
2
);
if
(
tmpUrl
.
length
>
1
)
{
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"
;
this
.
height
=
this
.
iframe
.
nativeElement
.
contentWindow
.
document
.
body
.
scrollHeight
+
"px"
;
}
}
...
...
code/moya-web/WebContent/resources/templates/nglayout/template.xhtml
View file @
f0306ea
...
@@ -183,7 +183,7 @@
...
@@ -183,7 +183,7 @@
var
realUrl
=
"/MoyaNG/old"
;
var
realUrl
=
"/MoyaNG/old"
;
if
(
url
.
length
>
1
)
{
if
(
url
.
length
>
1
)
{
realUrl
=
"/MoyaNG/old
#
"
+
url
[
1
];
realUrl
=
"/MoyaNG/old
?p=
"
+
url
[
1
];
}
}
document
.
location
.
href
=
realUrl
;
document
.
location
.
href
=
realUrl
;
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/v2/VipRestView.java
View file @
f0306ea
package
fi
.
codecrew
.
moya
.
rest
.
v2
;
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
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.DELETE
;
import
javax.ws.rs.GET
;
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
;
import
io.swagger.annotations.Api
;
import
fi.codecrew.moya.beans.PermissionBeanLocal
;
import
fi.codecrew.moya.beans.PermissionBeanLocal
;
import
fi.codecrew.moya.beans.ProductBeanLocal
;
import
fi.codecrew.moya.beans.ProductBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/v3/VipRestViewV3.java
View file @
f0306ea
...
@@ -16,10 +16,12 @@ import io.swagger.annotations.Api;
...
@@ -16,10 +16,12 @@ import io.swagger.annotations.Api;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.enterprise.context.RequestScoped
;
import
javax.ws.rs.*
;
import
javax.ws.rs.*
;
import
javax.ws.rs.core.GenericEntity
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
javax.ws.rs.core.Response
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
...
@@ -47,7 +49,7 @@ public class VipRestViewV3 {
...
@@ -47,7 +49,7 @@ public class VipRestViewV3 {
@Path
(
"/all"
)
@Path
(
"/all"
)
public
Response
getAllVips
()
{
public
Response
getAllVips
()
{
ArrayList
<
VipRestPojoV3
>
ret
=
VipRestPojoV3
.
create
(
vipbean
.
getAvailableVips
());
ArrayList
<
VipRestPojoV3
>
ret
=
VipRestPojoV3
.
create
(
vipbean
.
getAvailableVips
());
return
Response
.
ok
(
ret
).
build
();
return
Response
.
ok
(
new
GenericEntity
<
List
<
VipRestPojoV3
>>(
ret
)
{}
).
build
();
}
}
@GET
@GET
...
@@ -58,7 +60,7 @@ public class VipRestViewV3 {
...
@@ -58,7 +60,7 @@ public class VipRestViewV3 {
sq
.
setPagesize
(
0
);
sq
.
setPagesize
(
0
);
SearchResult
<
Vip
>
result
=
vipbean
.
search
(
sq
);
SearchResult
<
Vip
>
result
=
vipbean
.
search
(
sq
);
ArrayList
<
VipRestPojoV3
>
ret
=
VipRestPojoV3
.
create
(
result
.
getResults
());
ArrayList
<
VipRestPojoV3
>
ret
=
VipRestPojoV3
.
create
(
result
.
getResults
());
return
Response
.
ok
(
ret
).
build
();
return
Response
.
ok
(
new
GenericEntity
<
List
<
VipRestPojoV3
>>(
ret
)
{}
).
build
();
}
}
@DELETE
@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