Examples of Grammars


Examples of com.azaptree.wadl.Grammars

    Assert.hasText(applicationHttpUrlBase, "applicationHttpUrlBase is required");
    this.applicationHttpUrlBase = applicationHttpUrlBase;
  }

  private Grammars createWadlGrammars() {
    final Grammars grammars = new Grammars();
    final List<CommandKey> keys = new ArrayList<>(targetUriCommandKeyMap.values());
    Collections.sort(keys);
    for (final CommandKey commandKey : keys) {
      final WebRequestCommand<?, ?> command = (WebRequestCommand<?, ?>) commandService.getCommand(commandKey);
      if (command.hasXmlSchema()) {
        final Include include = new Include();
        include.setHref(String.format("%s/command-service/%s/%s.xsd", applicationHttpUrlBase, commandKey.getCatalogName(), commandKey.getCommandName()));
        grammars.getInclude().add(include);
      }
    }
    return grammars;
  }
View Full Code Here

Examples of com.sun.research.ws.wadl.Grammars


        // Add a reference to this grammar
        //

        Grammars grammars;
        if (application.getGrammars() != null) {
            LOG.info("The wadl application already contains a grammars element,"
                    + " we're adding elements of the provided grammars file.");
            grammars = application.getGrammars();
        } else {
            grammars = new Grammars();
            application.setGrammars(grammars);
        }

        // Create a reference back to the root WADL
        //

        for (String path : applicationDescription.getExternalMetadataKeys()) {
            ApplicationDescription.ExternalGrammar eg =
                    applicationDescription.getExternalGrammar(path);
           
            if (!eg.isIncludedInGrammar()) {
                continue;
            }
           
            URI schemaURI =
                    extendedPath.clone().path(path).build();

            String schemaURIS = schemaURI.toString();
            String requestURIs = requestURI.toString();

            String schemaPath = rootURI != null
                    ? requestURI.relativize(schemaURI).toString()
                    : schemaURI.toString();

            Include include = new Include();
            include.setHref(schemaPath);
            Doc doc = new Doc();
            doc.setLang("en");
            doc.setTitle("Generated");
            include.getDoc().add(doc);

            // Finally add to list
            grammars.getInclude().add(include);
        }
    }
View Full Code Here

Examples of com.sun.research.ws.wadl.Grammars


            // Add a reference to this grammar
            //

            Grammars grammars;
            if (application.getGrammars() != null) {
                LOGGER.info(LocalizationMessages.ERROR_WADL_GRAMMAR_ALREADY_CONTAINS());
                grammars = application.getGrammars();
            } else {
                grammars = new Grammars();
                application.setGrammars(grammars);
            }

            // Create a reference back to the root WADL
            //

            for (String path : applicationDescription.getExternalMetadataKeys()) {
                URI schemaURI =
                        extendedPath.clone().path(path).build();

                String schemaPath = rootURI != null ?
                        requestURI.relativize(schemaURI).toString()
                        : schemaURI.toString();

                Include include = new Include();
                include.setHref(schemaPath);
                Doc doc = new Doc();
                doc.setLang("en");
                doc.setTitle("Generated");
                include.getDoc().add(doc);

                // Finally add to list
                grammars.getInclude().add(include);
            }
        } catch (Exception e) {
            throw new ProcessingException(LocalizationMessages.ERROR_WADL_EXTERNAL_GRAMMAR(), e);
        }
    }
View Full Code Here

Examples of com.sun.research.ws.wadl.Grammars


            // Add a reference to this grammar
            //

            final Grammars grammars;
            if (application.getGrammars() != null) {
                LOGGER.info(LocalizationMessages.ERROR_WADL_GRAMMAR_ALREADY_CONTAINS());
                grammars = application.getGrammars();
            } else {
                grammars = new Grammars();
                application.setGrammars(grammars);
            }

            // Create a reference back to the root WADL
            //

            for (final String path : applicationDescription.getExternalMetadataKeys()) {
                final URI schemaURI = extendedPath.clone().path(path).build();
                final String schemaPath = rootURI != null ? requestURI.relativize(schemaURI).toString() : schemaURI.toString();

                final Include include = new Include();
                include.setHref(schemaPath);
                final Doc doc = new Doc();
                doc.setLang("en");
                doc.setTitle("Generated");
                include.getDoc().add(doc);

                // Finally add to list
                grammars.getInclude().add(include);
            }
        } catch (final Exception e) {
            throw new ProcessingException(LocalizationMessages.ERROR_WADL_EXTERNAL_GRAMMAR(), e);
        }
    }
View Full Code Here

Examples of com.sun.research.ws.wadl.Grammars


        // Add a reference to this grammar
        //

        Grammars grammars;
        if ( application.getGrammars() != null ) {
            LOG.info( "The wadl application already contains a grammars element," +
                      " we're adding elements of the provided grammars file." );
            grammars = application.getGrammars();
        } else {
            grammars = new Grammars();
            application.setGrammars( grammars );
        }

        // Create a reference back to the root WADL
        //

        for (String path : applicationDescription.getExternalMetadataKeys())
        {
            URI schemaURI =
                extendedPath.clone().path( path ).build();

            String schemaURIS = schemaURI.toString();
            String requestURIs = requestURI.toString();

            String schemaPath = rootURI!=null ?
                    requestURI.relativize(schemaURI).toString()
                    : schemaURI.toString();

            Include include = new Include();
            include.setHref( schemaPath );
            Doc doc = new Doc();
            doc.setLang( "en" );
            doc.setTitle( "Generated" );
            include.getDoc().add( doc );

            // Finally add to list
            grammars.getInclude().add(include);
        }
    }
View Full Code Here

Examples of com.sun.research.ws.wadl.Grammars


            // Add a reference to this grammar
            //

            Grammars grammars;
            if (application.getGrammars() != null) {
                LOGGER.info(LocalizationMessages.ERROR_WADL_GRAMMAR_ALREADY_CONTAINS());
                grammars = application.getGrammars();
            } else {
                grammars = new Grammars();
                application.setGrammars(grammars);
            }

            // Create a reference back to the root WADL
            //

            for (String path : applicationDescription.getExternalMetadataKeys()) {
                URI schemaURI =
                        extendedPath.clone().path(path).build();

                String schemaPath = rootURI != null ?
                        requestURI.relativize(schemaURI).toString()
                        : schemaURI.toString();

                Include include = new Include();
                include.setHref(schemaPath);
                Doc doc = new Doc();
                doc.setLang("en");
                doc.setTitle("Generated");
                include.getDoc().add(doc);

                // Finally add to list
                grammars.getInclude().add(include);
            }
        } catch (Exception e) {
            throw new ProcessingException(LocalizationMessages.ERROR_WADL_EXTERNAL_GRAMMAR(), e);
        }
    }
View Full Code Here

Examples of net.java.dev.wadl.x2009.x02.GrammarsDocument.Grammars

    }

    String[] namespaces = InferredSchemaManager.getInferredSchema( restService ).getNamespaces();
    if( namespaces.length > 0 )
    {
      Grammars grammars = application.addNewGrammars();
      for( String namespace : namespaces )
      {
        grammars.addNewInclude().setHref( InferredSchemaManager.filenameForNamespace( namespace ) );
      }
    }

    if( !isWADL11 )
    {
View Full Code Here

Examples of net.java.dev.wadl.x2009.x02.GrammarsDocument.Grammars

            resources.addNewResource().set(generateWadlResource(restService.getOperationAt(c)));
        }

        String[] namespaces = InferredSchemaManager.getInferredSchema(restService).getNamespaces();
        if (namespaces.length > 0) {
            Grammars grammars = application.addNewGrammars();
            for (String namespace : namespaces) {
                grammars.addNewInclude().setHref(InferredSchemaManager.filenameForNamespace(namespace));
            }
        }

        if (!isWADL11) {
            XmlOptions options = new XmlOptions();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.