*/
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
+import { HttpClientModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
BrowserModule,
AppRoutingModule,
FormsModule,
+ HttpClientModule,
],
providers: [],
bootstrap: [AppComponent]
// noinspection ES6UnusedImports
import { FormsModule } from "@angular/forms";
import { Logindata } from "../../../logindata";
+import { LoginService } from "../../../services/login.service";
@Component({
selector: 'app-login',
get diagnostic() { return JSON.stringify(this.submitted); }
- constructor() { }
+ login(): void {
+ this.loginService.login(username, password);
+ }
+
+ constructor(private loginService: LoginService) { }
ngOnInit(): void {
}
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { TestBed } from '@angular/core/testing';
+
+import { ArchivaRequestService } from './archiva-request.service';
+
+describe('ArchivaRequestService', () => {
+ let service: ArchivaRequestService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(ArchivaRequestService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Injectable } from '@angular/core';
+import { HttpClient } from "@angular/common/http";
+import { environment } from "../../environments/environment";
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ArchivaRequestService {
+
+
+ executeRestCall(type: string, module: string, service: string, input: object, callback: (result: object) => void ) : void {
+ let modulePath = environment.application.servicePaths[module];
+ let url = environment.application.baseUrl + environment.application.restPath + "/"+modulePath+"/" + service + "Service";
+ if (type == "get") {
+ this.http.get(url,)
+ } else if ( type == "post") {
+ this.http.post(url);
+ }
+ }
+
+ constructor(private http : HttpClient) { }
+}
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { TestBed } from '@angular/core/testing';
+
+import { LoginService } from './login.service';
+
+describe('LoginService', () => {
+ let service: LoginService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(LoginService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Injectable } from '@angular/core';
+import { ArchivaRequestService } from "./archiva-request.service";
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class LoginService {
+
+ login(username: string, password: string) {
+
+ throw new Error("Method not implemented.");
+ }
+
+ constructor(private archiva : ArchivaRequestService) { }
+}
production: false,
application:
{
+ baseUrl: 'http://localhost:8080',
+ restPath: '/restServices',
+ servicePaths: {
+ archiva:"archivaServices",
+ redback:"redbackServices",
+ ui:"archivaUiServices"
+ },
name: 'archiva-starter',
angular: 'Angular 10.0.2',
bootstrap: 'Bootstrap 4.5.0',
<load-on-startup>1</load-on-startup>
</servlet>
+ <servlet>
+ <servlet-name>CXFServletV2</servlet-name>
+ <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/restServices/*</url-pattern>
</servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>CXFServletV2</servlet-name>
+ <url-pattern>/api/*</url-pattern>
+ </servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>