Commit 23068833 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174284 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 522a6741
...@@ -9,21 +9,22 @@ import { Store } from '@ngrx/store'; ...@@ -9,21 +9,22 @@ import { Store } from '@ngrx/store';
import {AppState} from '../ecm-store/reducers'; import {AppState} from '../ecm-store/reducers';
import {OrderActions} from '../ecm-store/actions'; import {OrderActions} from '../ecm-store/actions';
import { Order } from '../ecm-model/order-model'; import { Order } from '../ecm-model/order-model';
import { HostUrlService } from '../host-url.service';
@Injectable() @Injectable()
export class EcmOrderService { export class EcmOrderService {
private orderActionUrl = '/ibase/ecm/service'; private orderActionUrl = '/ecm/service/orders';
orderItems: Order[]; orderItems: Order[];
constructor( private http: Http, private store: Store<AppState> ) { } constructor( private http: Http, private store: Store<AppState>, public hostUrlService : HostUrlService ) { }
fetchOrder(): Observable<Order[]> { fetchOrder(): Observable<Order[]> {
console.log( "fetch Orders Called" ); console.log( "fetch Orders Called" );
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
return this.http.get( this.orderActionUrl + "/orders", options ) return this.http.get( this.hostUrlService.hostUrl+this.orderActionUrl, options )
.map( (res) => this.extractData(res) ) .map( (res) => this.extractData(res) )
.catch(this.handleError); .catch(this.handleError);
} }
...@@ -34,7 +35,7 @@ export class EcmOrderService { ...@@ -34,7 +35,7 @@ export class EcmOrderService {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
return this.http.post( '/ibase/ecm/service/orders', JSON.stringify(order) , options) return this.http.post( this.hostUrlService.hostUrl+this.orderActionUrl, JSON.stringify(order) , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
...@@ -44,7 +45,7 @@ export class EcmOrderService { ...@@ -44,7 +45,7 @@ export class EcmOrderService {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
return this.http.post( '/ibase/ecm/service/orders', JSON.stringify(order) , options) return this.http.post( this.hostUrlService.hostUrl+this.orderActionUrl, JSON.stringify(order) , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
......
...@@ -3,12 +3,13 @@ import {Http, Response, Headers, RequestOptions} from '@angular/http'; ...@@ -3,12 +3,13 @@ import {Http, Response, Headers, RequestOptions} from '@angular/http';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import { HostUrlService } from '../../host-url.service';
@Injectable() @Injectable()
export class SearchService { export class SearchService {
val; val;
constructor(private http:Http) { } constructor(private http:Http, public hostUrlService : HostUrlService) { }
setSearch(value){ setSearch(value){
console.log('Set Query:['+value+']'); console.log('Set Query:['+value+']');
...@@ -22,7 +23,7 @@ export class SearchService { ...@@ -22,7 +23,7 @@ export class SearchService {
getSuggestions(value) { getSuggestions(value) {
console.log('Query:['+value+']'); console.log('Query:['+value+']');
let solrUrl = '/ibase/ecm/service/solr/local2do/'; let solrUrl = this.hostUrlService.hostUrl + '/ecm/service/solr/local2do/';
solrUrl = solrUrl+value+'/json'; solrUrl = solrUrl+value+'/json';
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
......
...@@ -49,7 +49,7 @@ private userActionUrl = '/ecm/service/feeds/cart'; ...@@ -49,7 +49,7 @@ private userActionUrl = '/ecm/service/feeds/cart';
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
return this.http.post( this.hostUrlService.hostUrl+this.SERVICE_URL, JSON.stringify(cartData) , options) return this.http.post( this.hostUrlService.hostUrl+this.userActionUrl, JSON.stringify(cartData) , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
......
...@@ -11,14 +11,14 @@ import { HostUrlService } from '../../host-url.service'; ...@@ -11,14 +11,14 @@ import { HostUrlService } from '../../host-url.service';
@Injectable() @Injectable()
export class EcmRelatedItemService { export class EcmRelatedItemService {
private trendsUrl = '/ecm/service/category/related'; // URL to web service private SERVICE_URL = '/ecm/service/category/related'; // URL to web service
constructor (private http: Http,public hostUrlService : HostUrlService) {} constructor (private http: Http,public hostUrlService : HostUrlService) {}
getRelatedItems(scatCode): Observable<ItemDetail[]> { getRelatedItems(scatCode): Observable<ItemDetail[]> {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
let URL = this.hostUrlService.hostUrl+this.trendsUrl + '/' +scatCode; let URL = this.hostUrlService.hostUrl+this.SERVICE_URL + '/' +scatCode;
return this.http.get( URL, options ) return this.http.get( URL, options )
.map( (res) => this.extractData(res) ) .map( (res) => this.extractData(res) )
......
...@@ -44,7 +44,7 @@ export class EcmWishListService { ...@@ -44,7 +44,7 @@ export class EcmWishListService {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
return this.http.post( this.hostUrlService.hostUrl+'/ecm/service/feeds/wishlist/'+itemCode , options) return this.http.post( this.hostUrlService.hostUrl+this.wishListUrl+'/'+itemCode , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
...@@ -52,7 +52,7 @@ export class EcmWishListService { ...@@ -52,7 +52,7 @@ export class EcmWishListService {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
return this.http.delete( this.hostUrlService.hostUrl+'/ecm/service/feeds/wishlist/'+itemCode, options) return this.http.delete( this.hostUrlService.hostUrl+this.wishListUrl+'/'+itemCode, options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
......
...@@ -36,7 +36,7 @@ export class ProfileInfoService { ...@@ -36,7 +36,7 @@ export class ProfileInfoService {
let headers = new Headers( { 'Content-Type': 'application/json' }); let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers }); let options = new RequestOptions( { headers: headers });
return this.http.post( '/ecm/service/feeds/profile', JSON.stringify(userData) , options) return this.http.post( this.hostUrlService.hostUrl+this.userActionUrl, JSON.stringify(userData) , options)
.map( (res) => this.extractData(res) ); .map( (res) => this.extractData(res) );
} }
......
...@@ -57,7 +57,7 @@ export class UserReviewService { ...@@ -57,7 +57,7 @@ export class UserReviewService {
deleteCartItem( userReview ) { deleteCartItem( userReview ) {
console.log( "deleteUserreview Called" ); console.log( "deleteUserreview Called" );
return this.http.delete( this.userActionUrl + '/' + userReview.userCode, {}) return this.http.delete( this.hostUrlService.hostUrl + this.userActionUrl + '/' + userReview.userCode, {})
.map( res => res.json() ); .map( res => res.json() );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment