@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!isDisabled()) { if (!amfRtFound) { warn("WARNING! The AMF module is enabled, but the Enunciate AMF runtime libraries were found on the Enunciate classpath. " + "Application startup will fail unless the Enunciate AMF runtime libraries are on the classpath."); } } }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!isDisabled()) { if (!gwtRtFound && !isGenerateJsonOverlays()) { info("GWT runtime wasn't found on the classpath. If you're doing GWT-RPC, you're going to fail at runtime."); } } }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); warn("The Enunciate REST module has been deprecated in favor of JAX-RS, and will soon be removed from the core Enunciate build. It would be wise for you to move to the JAX-RS model."); if (!isDisabled()) { Map<RESTNoun, Set<String>> nouns2contentTypes = model.getNounsToContentTypes(); Map<String, String> contentTypes2Ids = model.getContentTypesToIds(); contentTypes2Ids.put("application/json", "json"); //it's assumed we've got some json provider on the classpath... for (Map.Entry<RESTNoun, List<RESTMethod>> nounMethodEntry : model.getNounsToRESTMethods().entrySet()) { Map<String, Set<String>> subcontexts = new HashMap<String, Set<String>>(); RESTNoun restNoun = nounMethodEntry.getKey(); subcontexts.put(null, new TreeSet<String>(Arrays.asList(getRestSubcontext()))); for (String contentType : nouns2contentTypes.get(restNoun)) { String contentTypeId = contentTypes2Ids.get(contentType); if (contentTypeId != null) { subcontexts.put(contentType, new TreeSet<String>(Arrays.asList("/" + contentTypeId))); } } for (RESTMethod restMethod : nounMethodEntry.getValue()) { restMethod.putMetaData("defaultSubcontext", getRestSubcontext()); restMethod.putMetaData("subcontexts", subcontexts); } } } }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!isDisabled()) { for (SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) { for (TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) { String pckg = typeDefinition.getPackage().getQualifiedName(); if (!this.packageToModuleConversions.containsKey(pckg)) { this.packageToModuleConversions.put(pckg, packageToModule(pckg)); } } } } }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!isDisabled()) { for (SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) { for (TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) { String pckg = typeDefinition.getPackage().getQualifiedName(); if (!this.packageToModuleConversions.containsKey(pckg)) { this.packageToModuleConversions.put(pckg, packageToModule(pckg)); } } } } }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!getModelInternal().getNamespacesToWSDLs().isEmpty()) { String docsDir = getDocsDir() == null ? "" : getDocsDir(); if (!docsDir.startsWith("/")) { docsDir = "/" + docsDir; } while (docsDir.endsWith("/")) { docsDir = docsDir.substring(0, docsDir.length() - 1); } for (WsdlInfo wsdlInfo : getModelInternal().getNamespacesToWSDLs().values()) { Object filename = wsdlInfo.getProperty("filename"); if (filename != null) { wsdlInfo.setProperty("redirectLocation", docsDir + "/" + filename); } } } EnunciateConfiguration config = model.getEnunciateConfig(); for (RootResource resource : model.getRootResources()) { for (ResourceMethod resourceMethod : resource.getResourceMethods(true)) { if (!resourceMethod.getMetaData().containsKey("defaultSubcontext")) { //if we don't have the defaultSubcontext set by some other jax-rs implementation provider module //then we need to set it ourselves. resourceMethod.putMetaData("defaultSubcontext", config == null ? "/rest" : config.getDefaultRestSubcontext()); } } } }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model);