Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add xsds for 4.1 #5412

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion impl/src/main/java/com/sun/faces/config/manager/FacesSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_3_0_XSD_FILE;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_0_XSD;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_0_XSD_FILE;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_1_XSD;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_1_XSD_FILE;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_CONFIG_1_X_DEFAULT_NS;
import static com.sun.faces.config.manager.FacesSchema.Schemas.JAKARTAEE_SCHEMA_DEFAULT_NS;
import static com.sun.faces.config.manager.FacesSchema.Schemas.JAVAEE_SCHEMA_DEFAULT_NS;
Expand Down Expand Up @@ -63,13 +65,15 @@ public enum FacesSchema {
FACES_23(FACES_2_3_XSD, FACES_2_3_XSD_FILE),
FACES_30(FACES_3_0_XSD, FACES_3_0_XSD_FILE),
FACES_40(FACES_4_0_XSD, FACES_4_0_XSD_FILE),
FACES_41(FACES_4_1_XSD, FACES_4_1_XSD_FILE),

// taglib.xml
FACELET_TAGLIB_20(Schemas.FACELET_TAGLIB_2_0_XSD, Schemas.FACELET_TAGLIB_2_0_XSD_FILE),
FACELET_TAGLIB_22(Schemas.FACELET_TAGLIB_2_2_XSD, Schemas.FACELET_TAGLIB_2_2_XSD_FILE),
FACELET_TAGLIB_23(Schemas.FACELET_TAGLIB_2_3_XSD, Schemas.FACELET_TAGLIB_2_3_XSD_FILE),
FACELET_TAGLIB_30(Schemas.FACELET_TAGLIB_3_0_XSD, Schemas.FACELET_TAGLIB_3_0_XSD_FILE),
FACELET_TAGLIB_40(Schemas.FACELET_TAGLIB_4_0_XSD, Schemas.FACELET_TAGLIB_4_0_XSD_FILE);
FACELET_TAGLIB_40(Schemas.FACELET_TAGLIB_4_0_XSD, Schemas.FACELET_TAGLIB_4_0_XSD_FILE),
FACELET_TAGLIB_41(Schemas.FACELET_TAGLIB_4_1_XSD, Schemas.FACELET_TAGLIB_4_1_XSD_FILE);

/**
* Constants for individual schema files
Expand All @@ -90,6 +94,7 @@ public static class Schemas {
public static final String FACELET_TAGLIB_2_3_XSD = "/com/sun/faces/web-facelettaglibrary_2_3.xsd";
public static final String FACELET_TAGLIB_3_0_XSD = "/com/sun/faces/web-facelettaglibrary_3_0.xsd";
public static final String FACELET_TAGLIB_4_0_XSD = "/com/sun/faces/web-facelettaglibrary_4_0.xsd";
public static final String FACELET_TAGLIB_4_1_XSD = "/com/sun/faces/web-facelettaglibrary_4_1.xsd";

public static final String FACES_1_2_XSD = "/com/sun/faces/web-facesconfig_1_2.xsd";
public static final String FACES_1_1_XSD = "/com/sun/faces/web-facesconfig_1_1.xsd";
Expand All @@ -99,12 +104,14 @@ public static class Schemas {
public static final String FACES_2_3_XSD = "/com/sun/faces/web-facesconfig_2_3.xsd";
public static final String FACES_3_0_XSD = "/com/sun/faces/web-facesconfig_3_0.xsd";
public static final String FACES_4_0_XSD = "/com/sun/faces/web-facesconfig_4_0.xsd";
public static final String FACES_4_1_XSD = "/com/sun/faces/web-facesconfig_4_1.xsd";

public static final String FACELET_TAGLIB_2_0_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_2_0.xsd";
public static final String FACELET_TAGLIB_2_2_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_2_2.xsd";
public static final String FACELET_TAGLIB_2_3_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_2_3.xsd";
public static final String FACELET_TAGLIB_3_0_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_3_0.xsd";
public static final String FACELET_TAGLIB_4_0_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_4_0.xsd";
public static final String FACELET_TAGLIB_4_1_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_4_1.xsd";

// #### faces-config.xml XSDs within GlassFish

Expand All @@ -115,6 +122,7 @@ public static class Schemas {
public static final String FACES_2_3_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_2_3.xsd";
public static final String FACES_3_0_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_3_0.xsd";
public static final String FACES_4_0_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_4_0.xsd";
public static final String FACES_4_1_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_4_1.xsd";

/**
* Contains associations between grammar name and the physical resource.
Expand Down Expand Up @@ -160,6 +168,11 @@ public static class Schemas {
FACES_4_0_XSD,
FACES_4_0_XSD_FILE
},
{
"web-facesconfig_4_1.xsd",
FACES_4_1_XSD,
FACES_4_1_XSD_FILE
},
{
"facelet-taglib_1_0.dtd",
"/com/sun/faces/facelet-taglib_1_0.dtd",
Expand Down Expand Up @@ -190,6 +203,11 @@ public static class Schemas {
FACELET_TAGLIB_4_0_XSD,
FACELET_TAGLIB_4_0_XSD_FILE
},
{
"web-facelettaglibrary_4_1.xsd",
FACELET_TAGLIB_4_1_XSD,
FACELET_TAGLIB_4_1_XSD_FILE
},
{
"web-facesconfig_1_2.xsd",
FACES_1_2_XSD,
Expand Down Expand Up @@ -230,6 +248,11 @@ public static class Schemas {
"/com/sun/faces/jakartaee_10.xsd",
AS_SCHEMA_DIR + "jakartaee_10.xsd"
},
{
"jakartaee_11.xsd",
"/com/sun/faces/jakartaee_11.xsd",
AS_SCHEMA_DIR + "jakartaee_11.xsd"
},
{
"javaee_web_services_client_1_2.xsd",
"/com/sun/faces/javaee_web_services_client_1_2.xsd",
Expand Down Expand Up @@ -293,6 +316,12 @@ public static FacesSchema fromDocumentId(String documentNS, String version, Stri
switch (documentNS) {
case JAKARTAEE_SCHEMA_DEFAULT_NS: {
switch (version) {
case "4.1":
if ("facelet-taglib".equals(localName)) {
return FACELET_TAGLIB_41;
} else {
return FACES_41;
}
case "4.0":
if ("facelet-taglib".equals(localName)) {
return FACELET_TAGLIB_40;
Expand Down
Loading
Loading