XML Application Scoping 8-5
For example, if you put the parser or transformer classes in a JAR file called myparser.jar in the directory libxml, update the MANIFEST.MF file as
shown:
Manifest-Version: 1.0 Created-By: 1.3.1_01 Sun Microsystems Inc.
Class-Path: libxmlmyparser.jar
3.
If you want to store the parser or transformer classes in a location other than the EAR archive, be sure that you update the WebLogic Server CLASSPATH variable
to include the full pathname of the JAR file that contains the classes.
8.4 Configuring an External Entity for an Enterprise Application
You can store a local copy of an external entity, such as a DTD, in the EAR archive or exploded directory rather than always retrieving it from the Web.
To configure an external entity for an enterprise application:
1.
Create the directory libxmlregistry under the main directory of the EAR archive.
2.
Copy the external entity, such as a DTD, to the directory.
3.
Update the weblogic-application.xml file, using the entity-mapping sub-element of the xml element to map the name of the entity to entity
declarations in any XML files processed by the application, as shown in the following example:
entity-mapping entity-mapping-nameMy Mappingentity-mapping-name
public-id-BEA Systems, Inc.DTD for carsENpublic-id system-idhttp:www.bea.comdtdscar.dtdsystem-id
entity-uridtdscar.dtdentity-uri entity-mapping
In the example, a local copy of a DTD called car.dtd is stored in the libxmlregistrydtds directory under the main directory of the EAR
archive or exploded directory. The public ID of the entity is -BEA Systems, Inc.DTD for carsEN and the system id is
http:www.bea.comdtdscar.dtd. Whenever the application is parsing an XML file and it encounters an entity declaration using either one of the IDs, it will
substitute the car.dtd file.
8.5 Configuring the External Entity Cache for an Enterprise Application
You can specify that WebLogic Server cache external entities that are referenced with a URL or a pathname relative to the main directory of the EAR archive, either at
server-startup or when the entity is first referenced.
Caching the external entity saves the remote access time and provides a local backup in the event that the Administration Server cannot be accessed while an XML
document is being parsed, due to the network or the Administration server being down.
Note: Specify an entity-mapping element for each entity
declaration for which you want to map a local copy of the entity.
8-6 Programming XML for Oracle WebLogic Server
You can configure the expiration date of a cached entity, at which point WebLogic Server re-retrieves the entity from the URL or directory of the EAR and re-caches it.
Use the when-to-cache and cache-timeout-interval subelements of the entity-mapping element to configure external entity caching for an enterprise
application, as shown in the following example:
entity-mapping entity-mapping-nameMy Mappingentity-mapping-name
public-id-BEA Systems, Inc.DTD for carsENpublic-id system-idhttp:www.bea.comdtdscar.dtdsystem-id
entity-uridtdscar.dtdentity-uri when-to-cachecache-at-initializationwhen-to-cache
cache-timeout-interval300cache-timeout-interval entity-mapping
In the example, the car.dtd is stored in the libxmlregistrydtds directory under the main directory of the EAR archive or exploded directory. WebLogic Server
caches a copy of the DTD in its memory when it first starts up, and then refreshes the cached copy if it is stored for longer than 300 seconds.
9
Administering WebLogic Server XML 9-1
9
Administering WebLogic Server XML
The following sections describe XML administration with WebLogic Server:
■
Section 9.1, Overview of Administering WebLogic Server XML