Skip to content

Commit 7a62297

Browse files
committed
Update
1 parent 5e936ba commit 7a62297

File tree

291 files changed

+2976
-1242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+2976
-1242
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ client.log.*
4242
weblogic-bean-info-harvester/build-*
4343
run/work
4444
fortify-output/**
45+
owasp-output/**

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ The WebLogic Server Remote Console provides an alternative WebLogic Server admin
2222
## Differences With the WebLogic Server Administration Console
2323
If you are already familiar with the WebLogic Server Administration Console deployed as part of your WebLogic domain, you'll notice these key differences in the WebLogic Server Remote Console:
2424
* The user interface has been completely redesigned to conform to the Oracle Alta UI Design system and the Oracle Redwood theme included with Oracle JET.
25-
* The configuration and monitoring content is separated into separate pages in the Remote Console. In the WebLogic Server Administration Console, the configuration and runtime information is presented on one page.
25+
* The configuration and monitoring content is separated into separate pages in the Remote Console. In the WebLogic Server Administration Console, the configuration and runtime information is presented on one page. See [Separation of Configuration and Runtime Data](site/console_uidesign.md#separation).
2626
* The Change Center is now expressed as a shopping cart.
2727
* Instead of logging directly into the Administration Console deployed in a WebLogic domain, the Remote Console connects to the Administration Server in a WebLogic domain, with the credentials supplied by the user, using WebLogic REST APIs.
2828

2929
## Get Started
30-
The Oracle WebLogic Server Remote Console project repository is located at GitHub-URL. You can download a `console.zip` installer, or build the console from source. In this version, the console consists of the Remote Console JAR file, associated libraries necessary to use the console, and a web application that provides an extension that you can configure in your WebLogic Server domain. The extension provides additional functionality that is not available with the console only. Although installing the extension is optional, we recommend that you install it to get the optimum functionality from the Remote Console.
30+
You can download a `console.zip` installer, or build the console from source. In this version, the console consists of the Remote Console JAR file, associated libraries necessary to use the console, and a web application that provides an extension that you can configure in your WebLogic Server domain. The extension provides additional functionality that is not available with the console only. Although installing the extension is optional, we recommend that you install it to get the optimum functionality from the Remote Console.
3131

3232
To install the software, simply unzip the `console.zip` installer on a machine that has JDK 11 installed. After unzipping the archive, the console is ready to use. You simply start the console application, enter the console URL in a browser, and provide the Administration credentials and URL for the domain of your choice.
3333

common/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- Copyright 2020, Oracle Corporation and/or its affiliates. All rights reserved.
2+
<!-- Copyright 2020, 2021, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -->
44
<project xmlns="http://maven.apache.org/POM/4.0.0"
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -21,6 +21,12 @@
2121
<dependency>
2222
<groupId>io.helidon.microprofile.bundles</groupId>
2323
<artifactId>helidon-microprofile</artifactId>
24+
<exclusions>
25+
<exclusion>
26+
<groupId>org.jboss.weld.probe</groupId>
27+
<artifactId>weld-probe-core</artifactId>
28+
</exclusion>
29+
</exclusions>
2430
</dependency>
2531
<dependency>
2632
<groupId>com.fasterxml.jackson.jaxrs</groupId>

common/src/main/java/weblogic/console/backend/JavaxJsonUtils.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,25 @@ private static JsonArray throwableAsMessagesJsonArray(
7676
list.add(new Message(text, severity));
7777
}
7878
if (throwable != null) {
79-
String text1 = throwable.getLocalizedMessage();
79+
String text1 = getExceptionMessage(throwable);
8080
if (text1 != null && !text1.equals(text)) {
8181
list.add(new Message(text1, severity));
8282
}
8383
}
8484
return createMessagesJsonArray(list);
8585
}
86+
87+
private static String getExceptionMessage(Throwable t) {
88+
if (t == null) {
89+
return "";
90+
}
91+
String message = t.getLocalizedMessage();
92+
if (StringUtils.isEmpty(message)) {
93+
message = t.toString();
94+
}
95+
if (StringUtils.isEmpty(message)) {
96+
message = t.getClass().getName();
97+
}
98+
return message;
99+
}
86100
}

common/src/main/java/weblogic/console/backend/filter/CorsFilter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, Oracle Corporation and/or its affiliates.
1+
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package weblogic.console.backend.filter;
@@ -16,7 +16,6 @@ public class CorsFilter implements ContainerResponseFilter {
1616
// From https://www.baeldung.com/cors-in-jax-rs
1717
@Override
1818
public void filter(ContainerRequestContext req, ContainerResponseContext res) throws IOException {
19-
// TODO: These settings are not for production use!
2019
List<String> origin = req.getHeaders().get("Origin");
2120

2221
// whitelist localhost:8000 - ojet serve

common/src/main/java/weblogic/console/backend/integration/WebLogicRestRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle Corporation and/or its affiliates.
1+
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package weblogic.console.backend.integration;
@@ -104,7 +104,6 @@ public Builder header(String key, Object value) {
104104
*/
105105
public Builder asynchronous(boolean asynchronous) {
106106
// Synchronously wait for 2 seconds if case the operation returns quickly.
107-
// TBD - should the wait time be configurable?
108107
if (asynchronous) {
109108
return header("Prefer", "wait=2");
110109
} else {

console-rest-ext/src/main/java/weblogic/console/wls/rest/extension/ChangesFormatter.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, Oracle Corporation and/or its affiliates.
1+
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package weblogic.console.wls.rest.extension;
@@ -12,7 +12,6 @@
1212
import org.codehaus.jettison.json.JSONObject;
1313
import org.glassfish.admin.rest.utils.JsonFilter;
1414
import weblogic.descriptor.BeanUpdateEvent;
15-
import weblogic.management.rest.lib.bean.Constants;
1615
import weblogic.management.rest.lib.bean.utils.AttributeType;
1716
import weblogic.management.rest.lib.bean.utils.BeanType;
1817
import weblogic.management.rest.lib.bean.utils.BeanUtils;
@@ -362,7 +361,7 @@ private Object getPropertyValue(InvocationContext ic) throws Exception {
362361
return ((PropertyType)attrType).getMarshaller().marshal(ic, null, attrType, true);
363362
}
364363
if (this.attrType instanceof ReferencedBeanType) {
365-
return wrapIfExpandedValues(ic, getIdentity(value));
364+
return wrapIfExpandedValuesEnabled(ic, getIdentity(value));
366365
}
367366
if (this.attrType instanceof ReferencedBeansType) {
368367
JSONArray refs = new JSONArray();
@@ -371,7 +370,7 @@ private Object getPropertyValue(InvocationContext ic) throws Exception {
371370
identity.put("identity", getIdentity(ref));
372371
refs.put(identity);
373372
}
374-
return wrapIfExpandedValues(ic, refs);
373+
return wrapIfExpandedValuesEnabled(ic, refs);
375374
}
376375
throw
377376
new AssertionError(
@@ -486,12 +485,10 @@ private PropertyDescriptor findPropertyDescriptor(String propertyName) throws Ex
486485
// Converts an unexpanded property value into an expanded value
487486
// if the client asked for expanded values (including finding
488487
// out whether the property is set). Otherwise returns the unexpanded value.
489-
private Object wrapIfExpandedValues(InvocationContext ic, Object unwrappedValue) throws Exception {
488+
private Object wrapIfExpandedValuesEnabled(InvocationContext ic, Object unwrappedValue) throws Exception {
490489
if (ic.expandedValues()) {
491-
JSONObject wrappedValue = new JSONObject();
492-
wrappedValue.put(Constants.PROP_VALUE, unwrappedValue);
493-
wrappedValue.put(Constants.PROP_SET, BeanUtils.isBeanPropertySet(ic, this.attrType, true));
494-
return wrappedValue;
490+
boolean set = BeanUtils.isBeanPropertySet(ic, this.attrType, true);
491+
return ConsoleUtils.createExpandedValue(unwrappedValue, set);
495492
} else {
496493
return unwrappedValue;
497494
}

console-rest-ext/src/main/java/weblogic/console/wls/rest/extension/ChangesResource.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, Oracle Corporation and/or its affiliates.
1+
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package weblogic.console.wls.rest.extension;
@@ -10,6 +10,12 @@
1010

1111
/**
1212
* Returns the unactivated (saved and unsaved) changes in the default edit session.
13+
*
14+
* The remote console uses this endpoint to display the shopping cart contents.
15+
*
16+
* Since WLS REST api does not have an endpoint for getting the pending changes yet,
17+
* the console REST extension adds one. Long term, this functionality should be
18+
* moved into the WLS REST api.
1319
*/
1420
public class ChangesResource extends CustomSingletonChildResource {
1521

console-rest-ext/src/main/java/weblogic/console/wls/rest/extension/ConsoleBackendResource.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, Oracle Corporation and/or its affiliates.
1+
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package weblogic.console.wls.rest.extension;
@@ -10,11 +10,22 @@
1010
/**
1111
* The console backend resource returns information the console backend's
1212
* Weblogic REST extension.
13+
*
14+
* Currently the remote console does not call this endpoint.
15+
* Longer term, the CBE will use it to check whether the domain has a
16+
* compatible version of the console REST extension installed.
17+
*
18+
* The endpoint is
19+
* management/weblogic/<version>/edit/consoleBackend
20+
*
21+
* This endpoint is only visible if the client specifies the
22+
* enableConsoleRestExtension query parameter.
1323
*/
1424
public class ConsoleBackendResource extends CustomSingletonChildResource {
1525

1626
private static final String VERSION = "CBE_WLS_REST_EXTENSION_V1";
1727

28+
// Return the version of the console REST extension.
1829
@Override
1930
protected JSONObject getModel(JsonFilter.Scope filter) throws Exception {
2031
JSONObject item = new JSONObject();

console-rest-ext/src/main/java/weblogic/console/wls/rest/extension/ConsoleChangeManagerResource.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@
88
import weblogic.management.rest.lib.bean.resources.CustomSingletonChildResource;
99

1010
/**
11-
* The console provides the tree of resources that the console needs
11+
* The remote console provides the tree of resources that the console needs
1212
* for managing weblogic configuration transactions that the WLS REST
1313
* changeManager tree of resources doesn't provide.
14+
*
15+
* Long term, this functionality should be moved into the WLS REST api.
16+
*
17+
* Currently, it just adds one endpoint:
18+
* management/weblogic/<version>/edit/consoleChangeManager/changes
19+
*
20+
* This endpoint is only visible if the client specifies the
21+
* enableConsoleRestExtension query parameter.
1422
*/
1523
public class ConsoleChangeManagerResource extends CustomSingletonChildResource {
1624

0 commit comments

Comments
 (0)