Package org.apache.ws.commons.schema

Examples of org.apache.ws.commons.schema.XmlSchemaExternal


   * @param schema
   */
  protected void processImports(XmlSchema schema) {
    XmlSchemaObjectCollection imports = schema.getIncludes();
    for(Iterator it=imports.getIterator();it.hasNext();) {
      XmlSchemaExternal schemaImport = (XmlSchemaExternal)it.next();
      String location = schemaImport.getSchemaLocation();
      if(location!=null && location.length()>0 && schemaNameList.indexOf(location)==-1) {
        // on se base sur la location du shema
        schemaNameList.add(schemaImport.getSchemaLocation());
        log.info("Process import : "+schemaImport.getSchemaLocation());
        processSchema(schemaImport.getSchema());
      }
    }
  }
View Full Code Here


    private void updateSchemaRefs(XmlSchema parentSchema, String name) {
        for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
            Object obj = iter.next();
            if (obj instanceof XmlSchemaExternal) {
                XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
                String location = extSchema.getSchemaLocation();
                if (location.length() > 0 && location.indexOf(":/") < 0 && location.indexOf("?xsd=") < 0) {
                    extSchema.setSchemaLocation(name + "?xsd=" + location);
                }
                if (extSchema.getSchema() != null) {
                    updateSchemaRefs(extSchema.getSchema(), name);
                }
            }
        }
    }
View Full Code Here

    private XmlSchema getSchema(XmlSchema parentSchema, String name) {
        for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
            Object obj = iter.next();
            if (obj instanceof XmlSchemaExternal) {
                XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
                if (extSchema.getSchemaLocation().endsWith(name)) {
                    return extSchema.getSchema();
                } else {
                    XmlSchema schema = getSchema(extSchema.getSchema(), name);
                    if (schema != null) {
                        return schema;
                    }
                }
            }
View Full Code Here

    private static void updateSchemaRefs(XmlSchema parentSchema, String name) {
        for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
            Object obj = iter.next();
            if (obj instanceof XmlSchemaExternal) {
                XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
                String location = extSchema.getSchemaLocation();
                if (location.length() > 0 && location.indexOf(":/") < 0 && location.indexOf("?xsd=") < 0) {
                    extSchema.setSchemaLocation(name + "?xsd=" + location);
                }
                if (extSchema.getSchema() != null) {
                    updateSchemaRefs(extSchema.getSchema(), name);
                }
            }
        }
    }   
View Full Code Here

    private void updateSchemaRefs(XmlSchema parentSchema, String name) {
        for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
            Object obj = iter.next();
            if (obj instanceof XmlSchemaExternal) {
                XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
                String location = extSchema.getSchemaLocation();
                if (location.indexOf(":/") < 0 & location.indexOf("?xsd=") < 0) {
                    extSchema.setSchemaLocation(name + "?xsd=" + location);
                }
                updateSchemaRefs(extSchema.getSchema(), name);
            }
        }
    }
View Full Code Here

        schemaInfo.setMasterSchema(isMasterSchema);
        // set this as an visited schema to stop infinite traversal
        visitedSchemas.add(xmlSchema.getSourceURI());
        if (includes != null) {
            Object externalComponent;
            XmlSchemaExternal xmlSchemaExternal;
            XmlSchema innerSchema;
            for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                externalComponent = iter.next();
                if (externalComponent instanceof XmlSchemaExternal) {
                    xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                    innerSchema = xmlSchemaExternal.getSchema();
                    if (innerSchema != null) {
                        String sourceURI = innerSchema.getSourceURI();
                        if (isWSDLInlineSchema) {
                            dependencies.add(sourceURI);
                        }
View Full Code Here

            XmlSchemaObjectCollection includes = schema.getIncludes();
            if (includes != null) {
                for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                    Object externalComponent = iter.next();
                    if (externalComponent instanceof XmlSchemaExternal) {
                        XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                        XmlSchema schema1 = xmlSchemaExternal.getSchema();
                        if (schema1 != null) {
                            String sourceURI = getAbsoluteSchemaURL(schema1.getSourceURI());
                            if (schemas.containsKey(sourceURI)) {
                                SchemaInfo info = schemas.get(sourceURI);
                                String relativeSchemaPath = WSDLUtil.computeRelativePathWithVersion(schemaInfo.getProposedRegistryURL(), info.getProposedRegistryURL(), registry);
                                xmlSchemaExternal.setSchemaLocation(relativeSchemaPath);
                            }
                        }
                    }
                }
            }
View Full Code Here

            XmlSchemaObjectCollection includes = xmlSchema.getIncludes();
            // set this as an visited schema to stop recursion
            visitedSchemas.add(xmlSchema.getSourceURI());
            if (includes != null) {
                Object externalComponent;
                XmlSchemaExternal xmlSchemaExternal;
                XmlSchema innerSchema;
                for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                    externalComponent = iter.next();
                    if (externalComponent instanceof XmlSchemaExternal) {
                        xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                        innerSchema = xmlSchemaExternal.getSchema();
                        String sourceURI = innerSchema.getSourceURI();
                        // Process if we haven't already encountered this one
                        if (!processedSchemaMap.containsKey(sourceURI) &&
                            !visitedSchemas.contains(sourceURI)) {
                            calculateNewSchemaNames(innerSchema, processedSchemaMap, visitedSchemas,
View Full Code Here

            visitedSchemas.add(xmlSchema.getSourceURI());
            if (includes != null) {
                for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                    Object externalComponent = iter.next();
                    if (externalComponent instanceof XmlSchemaExternal) {
                        XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                        String sourceURI = xmlSchemaExternal.getSchema().getSourceURI();
                        if (!visitedSchemas.contains(sourceURI)) {
                            saveSchemaFileToRegistry(xmlSchemaExternal.getSchema(),
                                                     processedSchemaMap, null, visitedSchemas,
                                                     false, registryBasePath, processIncludes,
                                                     null);
                        }

                        // add the new name to changeschema map
                        // have to do before change the schema location
                        String newLocation = (String)processedSchemaMap.get(sourceURI);
                        if (isWSDLInlineSchema) {
                            changeSchemaNames.put(xmlSchemaExternal.getSchemaLocation(),
                                                  newLocation);
                        } else {

                        }
                        // set the new location
                        xmlSchemaExternal.setSchemaLocation(newLocation);
                        String innerFileNameToSave = (String)processedSchemaMap.get(sourceURI);
                        String innerXSDPath = getXSDPath(registryBasePath, innerFileNameToSave);
                        associations.add(innerXSDPath);
                    }
                }
View Full Code Here

  private void updateSchemaLocation(XmlSchema schema) throws AxisFault {
        XmlSchemaObjectCollection includes = schema.getIncludes();
        for (int j = 0; j < includes.getCount(); j++) {
            Object item = includes.getItem(j);
            if (item instanceof XmlSchemaExternal) {
                XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
                XmlSchema s = xmlSchemaExternal.getSchema();
                updateSchemaLocation(s, xmlSchemaExternal);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaExternal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.