Skip to content

Commit

Permalink
Start 5.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed May 11, 2024
1 parent dbc1993 commit ee1d6de
Show file tree
Hide file tree
Showing 47 changed files with 185 additions and 661 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/4.x.maven.yml → .github/workflows/5.x.maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,46 @@
# NOTE: this workflow file cannot have the same file name across all branches, otherwise each branch will pick the
# latest modified one. Hence the workflow files have each a different file name with the branch name as prefix.

name: 4.x
name: 5.x

on:
push:
branches: [ 4.x ]
branches: [ 5.x ]
pull_request:
branches: [ 4.x ]
branches: [ 5.x ]

permissions:
contents: read

jobs:
test:
name: Test 4.x on ${{matrix.server}}
name: Test 5.x on ${{matrix.server}}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
server: [ wildfly-mojarra4, liberty-myfaces3, glassfish-mojarra4, tomee-myfaces3, tomcat-mojarra4, tomcat-mojarra3, tomcat-myfaces4, tomcat-myfaces3 ]
server: [ wildfly-mojarra, glassfish-mojarra, tomcat-mojarra, tomcat-myfaces ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Test with Maven
run: mvn -B verify -P ${{matrix.server}}

deploy:
name: Deploy 4.x SNAPSHOT
name: Deploy 5.x SNAPSHOT
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
server-id: ossrh
server-username: OSSRH_USERNAME
Expand All @@ -69,7 +69,7 @@ jobs:
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}

analyze:
name: Analyze 4.x with Sonar
name: Analyze 5.x with Sonar
needs: test
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omnifaces",
"version": "4.0.0",
"version": "5.0",
"description": "Build omnifaces.unminified.js",
"license": "Apache-2.0",
"repository": {
Expand Down
466 changes: 63 additions & 403 deletions pom.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.util.HashSet;
import java.util.Set;

import org.omnifaces.cdi.Param;

import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.context.spi.CreationalContext;
import jakarta.enterprise.inject.Typed;
Expand All @@ -32,8 +34,6 @@
import jakarta.faces.convert.Converter;
import jakarta.faces.validator.Validator;

import org.omnifaces.cdi.Param;

/**
* Dynamic CDI producer used to work around CDI's restriction to create true generic producers.
* <p>
Expand Down Expand Up @@ -102,11 +102,6 @@ public boolean isAlternative() {
return false;
}

@Override
public boolean isNullable() {
return false;
}

@Override
public String getName() {
return null;
Expand Down
27 changes: 13 additions & 14 deletions src/main/java/org/omnifaces/cdi/push/Socket.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@
import java.util.Map.Entry;
import java.util.regex.Pattern;

import org.omnifaces.cdi.Push;
import org.omnifaces.cdi.PushContext;
import org.omnifaces.cdi.push.SocketEvent.Closed;
import org.omnifaces.cdi.push.SocketEvent.Opened;
import org.omnifaces.cdi.push.SocketEvent.Switched;
import org.omnifaces.component.script.ScriptFamily;
import org.omnifaces.util.Beans;
import org.omnifaces.util.Callback;
import org.omnifaces.util.Json;
import org.omnifaces.util.State;

import jakarta.el.ValueExpression;
import jakarta.enterprise.event.Observes;
import jakarta.faces.FacesException;
Expand All @@ -51,17 +62,6 @@
import jakarta.websocket.server.ServerContainer;
import jakarta.websocket.server.ServerEndpointConfig;

import org.omnifaces.cdi.Push;
import org.omnifaces.cdi.PushContext;
import org.omnifaces.cdi.push.SocketEvent.Closed;
import org.omnifaces.cdi.push.SocketEvent.Opened;
import org.omnifaces.cdi.push.SocketEvent.Switched;
import org.omnifaces.component.script.ScriptFamily;
import org.omnifaces.util.Beans;
import org.omnifaces.util.Callback;
import org.omnifaces.util.Json;
import org.omnifaces.util.State;

/**
* <p>
* The <code>&lt;o:socket&gt;</code> is an {@link UIComponent} whith opens an one-way (server to client) web socket
Expand Down Expand Up @@ -529,14 +529,13 @@
* }
* </pre>
* <p>
* Then use {@link jakarta.enterprise.inject.spi.BeanManager#fireEvent(Object, java.lang.annotation.Annotation...)} to
* fire the CDI event.
* Then use {@link jakarta.enterprise.inject.spi.BeanManager#getEvent()} to fire the CDI event.
* <pre>
* &#64;Inject
* private BeanManager beanManager;
*
* public void onSomeEntityChange(Entity entity) {
* beanManager.fireEvent(new PushEvent(entity.getSomeProperty()));
* beanManager.getEvent().select().fire(new PushEvent(entity.getSomeProperty()));
* }
* </pre>
* <p>
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/org/omnifaces/el/ELResolverWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
package org.omnifaces.el;

import java.beans.FeatureDescriptor;
import java.util.Iterator;

import jakarta.el.ELContext;
import jakarta.el.ELResolver;
import jakarta.faces.FacesWrapper;
Expand Down Expand Up @@ -72,11 +69,6 @@ public boolean isReadOnly(ELContext context, Object base, Object property) {
return getWrapped().isReadOnly(context, base, property);
}

@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
return getWrapped().getFeatureDescriptors(context, base);
}

@Override
public Class<?> getCommonPropertyType(ELContext context, Object base) {
return getWrapped().getCommonPropertyType(context, base);
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/omnifaces/el/ExpressionInspector.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@ public ELResolver getELResolver() {
return inspectorElResolver;
}

@Override
public Object convertToType(Object value, Class<?> type) {
return value;
@Override
@SuppressWarnings("unchecked")
public <T> T convertToType(Object value, Class<T> targetType) {
return (T) value;
}

public InspectorPass getPass() {
Expand Down
11 changes: 2 additions & 9 deletions src/main/java/org/omnifaces/el/FacesELResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
import static org.omnifaces.util.Utils.isOneInstanceOf;
import static org.omnifaces.util.Utils.startsWithOneOf;

import java.beans.FeatureDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.omnifaces.util.Faces;

import jakarta.el.ELContext;
import jakarta.el.ELResolver;
import jakarta.el.PropertyNotFoundException;

import org.omnifaces.util.Faces;

/**
* This EL resolver basically creates an implicit object <code>#{faces}</code> in EL scope.
* <p>
Expand Down Expand Up @@ -125,9 +123,4 @@ public boolean isReadOnly(ELContext context, Object base, Object property) {
return true;
}

@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ public abstract class DefaultResourceHandler extends ResourceHandlerWrapper {
/** The default URI when a resource is not found. */
public static final String RES_NOT_FOUND = "RES_NOT_FOUND";

/**
* The Faces 4+ script resource name.
* @since 4.0
*/
public static final String FACES_SCRIPT_RESOURCE_NAME = "faces.js";

// Constructors ---------------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import static org.omnifaces.util.Faces.getResourceAsStream;
import static org.omnifaces.util.FacesLocal.getRequest;
import static org.omnifaces.util.FacesLocal.getRequestContextPath;
import static org.omnifaces.util.Hacks.isFacesScriptResourceAvailable;

import java.io.ByteArrayInputStream;
import java.io.IOException;
Expand All @@ -40,6 +39,11 @@
import java.util.logging.Logger;
import java.util.regex.Pattern;

import org.omnifaces.util.Beans;
import org.omnifaces.util.Faces;
import org.omnifaces.util.FacesLocal;
import org.omnifaces.util.Json;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.RequestScoped;
import jakarta.enterprise.context.SessionScoped;
Expand All @@ -57,11 +61,6 @@
import jakarta.faces.view.ViewScoped;
import jakarta.servlet.http.HttpServletRequest;

import org.omnifaces.util.Beans;
import org.omnifaces.util.Faces;
import org.omnifaces.util.FacesLocal;
import org.omnifaces.util.Json;

/**
* <p>
* This {@link ResourceHandler} generates the <code>manifest.json</code> and also an offline-aware <code>sw.js</code>
Expand Down Expand Up @@ -442,7 +441,7 @@ private static Collection<String> getCacheableResources(WebAppManifest manifest)
}
}

cacheableResources.add(getResourceUrl(context, JSF_SCRIPT_LIBRARY_NAME, isFacesScriptResourceAvailable() ? FACES_SCRIPT_RESOURCE_NAME : JSF_SCRIPT_RESOURCE_NAME));
cacheableResources.add(getResourceUrl(context, FACES_SCRIPT_LIBRARY_NAME, FACES_SCRIPT_RESOURCE_NAME));
cacheableResources.add(getResourceUrl(context, OMNIFACES_LIBRARY_NAME, OMNIFACES_SCRIPT_NAME));
return cacheableResources;
}
Expand Down

0 comments on commit ee1d6de

Please sign in to comment.