Commit f0306ea8 by Tuukka Kivilahti

virpest fixed and some minor changes to stuff

1 parent 8c92f8dd
<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>
...@@ -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 }
]; ];
......
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";
} }
......
...@@ -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;
......
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;
......
...@@ -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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!