? websvc/restsamples/CustomerDB/test/unit ? websvc/restsamples/HelloWorld/test/unit ? websvc/swdp/external/jsr311-api-doc.zip Index: websvc/rest/manifest.mf =================================================================== RCS file: /cvs/websvc/rest/Attic/manifest.mf,v retrieving revision 1.9.2.2 diff -u -r1.9.2.2 manifest.mf --- websvc/rest/manifest.mf 11 Mar 2008 21:36:58 -0000 1.9.2.2 +++ websvc/rest/manifest.mf 28 Mar 2008 17:00:31 -0000 @@ -1,7 +1,7 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.netbeans.modules.websvc.rest/0 -OpenIDE-Module-Install: org/netbeans/modules/websvc/rest/RestModuleInstall.class -OpenIDE-Module-Layer: org/netbeans/modules/websvc/rest/resources/layer.xml -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/rest/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.6 -AutoUpdate-Show-In-Client: false +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.modules.websvc.rest/0 +OpenIDE-Module-Install: org/netbeans/modules/websvc/rest/RestModuleInstall.class +OpenIDE-Module-Layer: org/netbeans/modules/websvc/rest/resources/layer.xml +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/rest/resources/Bundle.properties +OpenIDE-Module-Specification-Version: 0.6.0.2 +AutoUpdate-Show-In-Client: false Index: websvc/rest/nbproject/project.xml =================================================================== RCS file: /cvs/websvc/rest/nbproject/Attic/project.xml,v retrieving revision 1.36.2.1 diff -u -r1.36.2.1 project.xml --- websvc/rest/nbproject/project.xml 11 Mar 2008 22:08:49 -0000 1.36.2.1 +++ websvc/rest/nbproject/project.xml 28 Mar 2008 17:00:31 -0000 @@ -243,7 +243,7 @@ 0 - 0.6 + 0.6.0.2 Index: websvc/rest/src/org/netbeans/modules/websvc/rest/RestUtils.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/Attic/RestUtils.java,v retrieving revision 1.26 diff -u -r1.26 RestUtils.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/RestUtils.java 15 Jan 2008 08:41:30 -0000 1.26 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/RestUtils.java 28 Mar 2008 17:00:31 -0000 @@ -44,6 +44,9 @@ import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.MethodTree; import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.List; import javax.lang.model.element.AnnotationMirror; import org.netbeans.api.java.source.JavaSource; @@ -61,7 +64,6 @@ import org.openide.filesystems.Repository; import org.openide.loaders.DataFolder; import org.openide.loaders.DataObject; -import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -250,8 +252,6 @@ String classAnonType = annotation.getAnnotationType().toString(); if (Constants.XML_ROOT_ELEMENT.equals(classAnonType)) { return true; - } else { - return false; } } } @@ -276,7 +276,7 @@ return false; } - public static String findElementName(MethodTree tree, ClientStubModel.Resource r) { + public static String findElementName(MethodTree tree) { String eName = ""; List mAnons = tree.getModifiers().getAnnotations(); if (mAnons != null && mAnons.size() > 0) { @@ -296,8 +296,6 @@ MethodTree method = null; List rTrees = JavaSourceHelper.getAllMethods(rSrc); for (MethodTree tree : rTrees) { - String mName = tree.getName().toString(); - ClientStubModel.Method m = null; boolean isHttpGetMethod = false; boolean isXmlMime = false; List mAnons = tree.getModifiers().getAnnotations(); @@ -306,10 +304,15 @@ String mAnonType = mAnon.getAnnotationType().toString(); if (RestConstants.GET_ANNOTATION.equals(mAnonType) || RestConstants.GET.equals(mAnonType)) { isHttpGetMethod = true; - } else if (RestConstants.PRODUCE_MIME_ANNOTATION.equals(mAnonType) || RestConstants.PRODUCE_MIME.equals(mAnonType)) { + } else if (RestConstants.PRODUCE_MIME_ANNOTATION.equals(mAnonType) || + RestConstants.PRODUCE_MIME.equals(mAnonType)) { + List mimes = getMimeAnnotationValue(mAnon); + if (mimes.contains(Constants.MimeType.JSON.value()) || + mimes.contains(Constants.MimeType.XML.value())) { isXmlMime = true; } } + } if (isHttpGetMethod && isXmlMime) { method = tree; break; @@ -342,6 +345,16 @@ if (value.indexOf("\"") != -1) value = value.substring(value.indexOf("\"") + 1, value.lastIndexOf("\"")); return value; + } + + public static List getMimeAnnotationValue(AnnotationTree ant) { + List ets = ant.getArguments(); + if (ets.size() > 0) { + String value = getValueFromAnnotation(ets.get(0)); + value = value.replace("\"", ""); + return Arrays.asList(value.split(",")); + } + return Collections.emptyList(); } public static String createGetterMethodName(ClientStubModel.RepresentationNode n) { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/ClientStubsGenerator.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/Attic/ClientStubsGenerator.java,v retrieving revision 1.22.2.5 diff -u -r1.22.2.5 ClientStubsGenerator.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/ClientStubsGenerator.java 11 Mar 2008 23:20:48 -0000 1.22.2.5 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/ClientStubsGenerator.java 28 Mar 2008 17:00:32 -0000 @@ -73,6 +73,7 @@ import org.netbeans.modules.websvc.rest.codegen.model.ClientStubModel.*; import org.openide.filesystems.FileSystem; import org.openide.loaders.DataObject; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; /** @@ -99,6 +100,7 @@ public static final String JS = "js"; //NOI18N public static final String HTML = "html"; //NOI18N public static final String HTM = "htm"; //NOI18N + public static final String TXT = "txt"; //NOI18N public static final String JSON = "json"; //NOI18N public static final String GIF = "gif"; //NOI18N public static final String JSP = "jsp"; //NOI18N @@ -122,7 +124,7 @@ public static final String JS_CONTAINERSTUB_TEMPLATE = "Templates/WebServices/JsContainerStub.js"; //NOI18N public static final String JS_CONTAINERITEMSTUB_TEMPLATE = "Templates/WebServices/JsContainerItemStub.js"; //NOI18N public static final String JS_GENERICSTUB_TEMPLATE = "Templates/WebServices/JsGenericStub.js"; //NOI18N - public static final String JS_README_TEMPLATE = "Templates/WebServices/JsReadme.html"; //NOI18N + public static final String JS_README_TEMPLATE = "Templates/WebServices/JsReadme.txt"; //NOI18N //Dojo templates public static final String DOJO_RESTSTORE = "RestStore";//NOI18N @@ -146,7 +148,7 @@ public static final String JMAKI_RESOURCESTABLE_DEST = "rtable"; //NOI18N public static final String JMAKI_RESOURCESTABLEUP_DEST = "rtableUp"; //NOI18N public static final String JMAKI_RESOURCESTABLEDOWN_DEST = "rtableDown"; //NOI18N - public static final String JMAKI_README_TEMPLATE = "Templates/WebServices/JmakiReadme.html"; //NOI18N + public static final String JMAKI_README_TEMPLATE = "Templates/WebServices/JmakiReadme.txt"; //NOI18N public static final String JMAKI_COMPONENTCSS_TEMPLATE = "Templates/WebServices/JmakiComponent.css"; //NOI18N public static final String JMAKI_COMPONENTHTM_TEMPLATE = "Templates/WebServices/JmakiComponent.htm"; //NOI18N public static final String JMAKI_COMPONENTJS_TEMPLATE = "Templates/WebServices/JmakiComponent.js"; //NOI18N @@ -301,7 +303,7 @@ new ResourceDojoComponents(r, rdjDir).generate(); new ResourceJmakiComponent(r, restDir).generate(); File dir = new File(FileUtil.toFile(templatesDir), DOJO+File.separator+REST); - dir.mkdirs(); + FileUtil.createFolder(dir); new ResourceJmakiTemplate(r, FileUtil.toFileObject(dir)).generate(); } } @@ -341,14 +343,14 @@ if (testFile != null) { files.add(testFile); } - FileObject readme = restDir.getFileObject(JMAKI_README, HTML); + FileObject readme = restDir.getFileObject(JMAKI_README, TXT); if(readme != null) files.add(readme); } else { FileObject rjsTest = rjsDir.getFileObject(JS_TESTSTUBS, HTML); if(rjsTest != null) files.add(rjsTest); - FileObject readme = rjsDir.getFileObject(JS_README, HTML); + FileObject readme = rjsDir.getFileObject(JS_README, TXT); if(readme != null) files.add(readme); } @@ -465,7 +467,7 @@ private void initJs(Project p) throws IOException { createDataObjectFromTemplate(JS_TESTSTUBS_TEMPLATE, rjsDir, JS_TESTSTUBS, HTML, false); createDataObjectFromTemplate(JS_STUBSUPPORT_TEMPLATE, rjsDir, JS_SUPPORT, JS, canOverwrite()); - createDataObjectFromTemplate(JS_README_TEMPLATE, rjsDir, JS_README, HTML, canOverwrite()); + createDataObjectFromTemplate(JS_README_TEMPLATE, rjsDir, JS_README, TXT, canOverwrite()); } private void initDojo(Project p, List resourceList) throws IOException { @@ -494,7 +496,7 @@ } private void initJmaki(Project p, List resourceList) throws IOException { - createDataObjectFromTemplate(JMAKI_README_TEMPLATE, restDir, JMAKI_README, HTML, canOverwrite()); + createDataObjectFromTemplate(JMAKI_README_TEMPLATE, restDir, JMAKI_README, TXT, canOverwrite()); createDataObjectFromTemplate(JMAKI_RESTBUNDLE_TEMPLATE, getRootDir().getParent(), BUNDLE, PROPERTIES, canOverwrite()); //find first container @@ -595,7 +597,7 @@ } out.close(); } catch (Exception e) { - e.printStackTrace(); + Exceptions.printStackTrace(e); } } @@ -640,10 +642,14 @@ } final File entryFile = new File(targetFolder, entry.getName()); if(entry.isDirectory()) { - if(!entryFile.exists() && !entryFile.mkdirs()) { + if(!entryFile.exists()) { + try { + FileObject fObj = FileUtil.createFolder(entryFile); + } catch(IOException iox) { throw new RuntimeException("Failed to create folder: " + entryFile.getName() + ". Terminating archive installation."); } + } } else { if(entryFile.exists() && overwrite) { if (!entryFile.delete()) { @@ -652,10 +658,14 @@ } } File parentFile = entryFile.getParentFile(); - if(!parentFile.exists() && !parentFile.mkdirs()) { + if(!parentFile.exists()) { + try { + FileObject fObj = FileUtil.createFolder(parentFile); + } catch(IOException iox) { throw new RuntimeException("Failed to create folder: " + parentFile.getName() + ". Terminating archive installation."); } + } targetFS.runAtomicAction(new FileSystem.AtomicAction() { public void run() throws IOException { FileOutputStream os = null; @@ -670,6 +680,7 @@ try { os.close(); } catch(IOException ex) { + Exceptions.printStackTrace(ex); } } } @@ -682,6 +693,7 @@ try { zip.close(); } catch(IOException ex) { + Exceptions.printStackTrace(ex); } } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/Constants.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/Attic/Constants.java,v retrieving revision 1.41.2.1 diff -u -r1.41.2.1 Constants.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/Constants.java 11 Mar 2008 22:08:50 -0000 1.41.2.1 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/Constants.java 28 Mar 2008 17:00:32 -0000 @@ -70,6 +70,8 @@ public static final String URI_INFO = RestConstants.REST_API_PACKAGE + "core.UriInfo"; //NOI18N + public static final String URI_BUILDER = RestConstants.REST_API_PACKAGE + "core.UriBuilder"; //NOI18N + public static final String URI_TYPE = "java.net.URI"; //NOI18N public static final String QUERY_TYPE = "javax.persistence.Query"; //NOI18N @@ -82,6 +84,10 @@ public static final String PERSISTENCE = "javax.persistence.Persistence"; + public static final String PERSISTENCE_ENTITY = "javax.persistence.Entity"; + + public static final String PERSISTENCE_TABLE = "javax.persistence.Table"; + public static final String NO_RESULT_EXCEPTION = "javax.persistence.NoResultException"; //NOI18N public static final String XML_ROOT_ELEMENT = "javax.xml.bind.annotation.XmlRootElement"; //NOI18N Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/EntityResourcesGenerator.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/Attic/EntityResourcesGenerator.java,v retrieving revision 1.9.2.1 diff -u -r1.9.2.1 EntityResourcesGenerator.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/EntityResourcesGenerator.java 11 Mar 2008 22:08:50 -0000 1.9.2.1 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/EntityResourcesGenerator.java 28 Mar 2008 17:00:33 -0000 @@ -73,6 +73,7 @@ import org.netbeans.modules.websvc.rest.wizard.Util; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; /** @@ -140,7 +141,8 @@ Constants.XML_ROOT_ELEMENT, Constants.XML_ELEMENT, Constants.XML_TRANSIENT, - Constants.XML_ATTRIBUTE + Constants.XML_ATTRIBUTE, + Constants.URI_BUILDER }; private static final String mimeTypes = "{\"" + MimeType.XML.value() + "\", \"" + @@ -225,7 +227,6 @@ classes.add(getRefConverterType(bean)); } } - classes.add(getPersistenceServiceClassType()); classes.add(getUriResolverClassType()); @@ -284,7 +285,7 @@ converterFolder = FileUtil.createFolder(new File(sourceRootDir, converterFolderPath)); } } catch (IOException ex) { - throw new IllegalArgumentException(ex); + Exceptions.printStackTrace(ex); } } @@ -313,7 +314,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -337,7 +338,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -409,7 +410,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -451,7 +452,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -495,7 +496,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -519,7 +520,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -560,7 +561,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -598,7 +599,7 @@ result.commit(); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } } @@ -1659,7 +1660,7 @@ Object returnType = Constants.URI_TYPE; String bodyText = "{if (isUriExtendable) {" + - "return uri.resolve($ID_TO_URI$ + \"/\");" + + "return UriBuilder.fromUri(uri).path($ID_TO_URI$ + \"/\").build();" + "}" + "return uri;" + "}"; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/GenericResourceGenerator.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/Attic/GenericResourceGenerator.java,v retrieving revision 1.11.2.1 diff -u -r1.11.2.1 GenericResourceGenerator.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/GenericResourceGenerator.java 11 Mar 2008 22:08:50 -0000 1.11.2.1 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/GenericResourceGenerator.java 28 Mar 2008 17:00:34 -0000 @@ -47,8 +47,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.lang.model.element.Modifier; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.ModificationResult; @@ -62,6 +60,7 @@ import org.netbeans.modules.websvc.rest.support.AbstractTask; import org.netbeans.modules.websvc.rest.support.JavaSourceHelper; import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; /** @@ -183,7 +182,7 @@ ); result.commit(); } catch (IOException ex) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "", ex); + Exceptions.printStackTrace(ex); } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/ClientStubModel.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/Attic/ClientStubModel.java,v retrieving revision 1.11 diff -u -r1.11 ClientStubModel.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/ClientStubModel.java 15 Jan 2008 08:41:30 -0000 1.11 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/ClientStubModel.java 28 Mar 2008 17:00:34 -0000 @@ -44,6 +44,8 @@ import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.MethodTree; import java.io.IOException; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -54,8 +56,6 @@ import javax.lang.model.element.AnnotationMirror; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.xpath.XPathExpressionException; import org.netbeans.api.project.Project; import org.netbeans.api.java.source.JavaSource; import org.netbeans.modules.websvc.rest.RestUtils; @@ -69,7 +69,6 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; /** * ClientStubModel @@ -115,6 +114,9 @@ continue; } String className = JavaSourceHelper.getClassNameQuietly(src); + if (className == null) { + continue; + } srcMap.put(className, src); if (RestUtils.isStaticResource(src)) { staticR.add(src); @@ -228,11 +230,7 @@ addResource(r); } } - } catch (XPathExpressionException ex) { - Exceptions.printStackTrace(ex); - } catch (SAXException ex) { - Exceptions.printStackTrace(ex); - } catch (ParserConfigurationException ex) { + } catch (Exception ex) { Exceptions.printStackTrace(ex); } return appName; @@ -397,17 +395,24 @@ MethodTree method = RestUtils.findGetAsXmlMethod(rSrc); // getXml() method tree if(method != null) { String converter = method.getReturnType().toString(); - RepresentationNode rootNode = createRootNode(converter, rDoc); + + RepresentationNode rootNode = null; + JavaSource js = getJavaSource(converter); + if (js != null) { + rootNode = createRootNode(js, rDoc); + } else { // check classpath + Class converterClass = TypeUtil.getClass(converter, rSrc, p); + if (converterClass != null) { + rootNode = createRootNode(converterClass, rDoc); + } + } rDoc.setRoot(rootNode); documentMap.put(converter, rDoc); processConverter(converter, rDoc, rootNode, r); } } - private RepresentationNode createRootNode(String cName, RepresentationDocument rr) { - JavaSource cSrc = getJavaSource(cName); - if(cSrc == null) - return null; + private RepresentationNode createRootNode(JavaSource cSrc, RepresentationDocument rr) { List annotations = JavaSourceHelper.getClassAnnotations(cSrc); if(annotations == null) return null; @@ -428,18 +433,45 @@ return null; } + private RepresentationNode createRootNode(Class converterClass, RepresentationDocument rr) { + List annotations = TypeUtil.getAnnotations(converterClass, true); + for (Annotation annotation : annotations) { + String cAnonType = annotation.annotationType().getName(); + if (Constants.XML_ROOT_ELEMENT_ANNOTATION.equals(cAnonType) || + Constants.XML_ROOT_ELEMENT.equals(cAnonType)) { + String rootName = TypeUtil.getAnnotationValueName(annotation); + RepresentationNode rootNode = new RepresentationNode(rootName); + rootNode.setIsRoot(true); + return rootNode; + } + } + return null; + } + private void processConverter(String converter, RepresentationDocument rr, - RepresentationNode rElem, Resource r) { + RepresentationNode rElem, Resource r) throws IOException { assert converter != null; String cName = converter; - if(cName.startsWith("Collection") || cName.startsWith("List") || - cName.startsWith("Set")) { + if(cName.indexOf("Collection<") > -1 || cName.indexOf("List<") > -1 || + cName.indexOf("Set<") > -1) + { if(cName.indexOf("<") != -1) cName = cName.substring(cName.indexOf("<")+1, cName.indexOf(">")); } + JavaSource cSrc = getJavaSource(cName); - if(cSrc == null) - return; + if(cSrc == null) { + Class cClass = TypeUtil.getClass(cName, r.getSource(), p); + if (cClass != null) { + processConverter(cClass, rr, rElem, r); + } + } else { + processConverter(cSrc, rr, rElem, r); + } + } + + private void processConverter(JavaSource cSrc, RepresentationDocument rr, + RepresentationNode rElem, Resource r) throws IOException { List annotations = JavaSourceHelper.getClassAnnotations(cSrc); if(annotations == null) return; @@ -455,7 +487,6 @@ List rTypes = new ArrayList(); for (int j=0;j mAnons = tree.getModifiers().getAnnotations(); if (mAnons == null) continue; @@ -472,7 +503,7 @@ RepresentationDocument cDoc = documentMap.get(c); RepresentationNode cElem = null; if(cDoc == null || cDoc.getRoot() == null) { - String eName = RestUtils.findElementName(tree, r); // "playlistRef" + String eName = RestUtils.findElementName(tree); // "playlistRef" cElem = new RepresentationNode(eName); cElem.setLink(tree); //getReferences() method tree for tracking the link elems.add(cElem);//process later @@ -486,7 +517,7 @@ * @XmlAttribute * public URI getUri() {} */ - String attrName = RestUtils.findElementName(tree, r); // "uri" + String attrName = RestUtils.findElementName(tree); // "uri" RepresentationNode attr = new RepresentationNode(attrName); attr.setLink(tree); rElem.addAttribute(attr); @@ -502,6 +533,84 @@ } } + private void processConverter(Class converterClass, RepresentationDocument rr, + RepresentationNode rElem, Resource r) throws IOException { + + rElem.setSource(null); + if (! TypeUtil.isXmlRoot(converterClass)) { + return; + } + + List elems = new ArrayList(); + for (java.lang.reflect.Method method : converterClass.getMethods()) { + String c = method.getGenericReturnType().toString(); + String defaultName = method.getName(); + if (defaultName.startsWith("get")) { //NOI18N + defaultName = defaultName.substring(3); + } + RepresentationDocument cDoc = documentMap.get(c); + Annotation xmlelementAnn = TypeUtil.getXmlElementAnnotation(method); + if (xmlelementAnn != null) { + collectElement(xmlelementAnn, rElem, cDoc, elems, c, defaultName); + } + } + + for (Field field : converterClass.getDeclaredFields()) { + String c = field.getGenericType().toString(); + RepresentationDocument cDoc = documentMap.get(c); + Annotation xmlelementAnn = TypeUtil.getXmlElementAnnotation(field); + if (xmlelementAnn != null) { + collectElement(xmlelementAnn, rElem, cDoc, elems, c, field.getName()); + } + Annotation xmlAttributeAnn = TypeUtil.getXmlAttributeAnnotation(field); + if (xmlAttributeAnn != null) { + collectAttribute(xmlAttributeAnn, rElem, field.getName()); + } + } + + //now process element methods + for (int j = 0; j < elems.size(); j++) { + processConverter(elems.get(j).getType(), rr, elems.get(j), r); + } + } + + private void collectElement(Annotation xmlAnn, RepresentationNode rElem, RepresentationDocument cDoc, + List elems, String type, String defaultName) { + + /* + * @XmlElement(name = "playlistRef") + * public Collection getReferences() {} + */ + RepresentationNode cElem = null; + if (cDoc == null || cDoc.getRoot() == null) { + String eName = TypeUtil.getAnnotationValueName(xmlAnn); // "playlistRef" + if (eName == null) { + eName = defaultName; + } + cElem = new RepresentationNode(eName); + cElem.setType(type); + cElem.setLink(null); //getReferences() method tree for tracking the link + elems.add(cElem);//process later + } else { + cElem = cDoc.getRoot(); + } + rElem.addChild(cElem); + } + + private void collectAttribute(Annotation xmlAnn, RepresentationNode rElem, String defaultName) { + /* + * @XmlAttribute + * public URI getUri() {} + */ + String attrName = TypeUtil.getAnnotationValueName(xmlAnn); // "uri" + if (attrName == null || attrName.equals("##default")) { //NOI18N + attrName = defaultName; + } + RepresentationNode attr = new RepresentationNode(attrName); + attr.setLink(null); + rElem.addAttribute(attr); + } + public class Resource { private String name; @@ -612,6 +721,7 @@ public class RepresentationNode { private String name; + private String type; private MethodTree link; private JavaSource src; @@ -675,6 +785,13 @@ protected void setSource(JavaSource src) { this.src = src; } + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } @Override public String toString() { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/EntityClassInfo.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/Attic/EntityClassInfo.java,v retrieving revision 1.11 diff -u -r1.11 EntityClassInfo.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/EntityClassInfo.java 30 Oct 2007 20:32:54 -0000 1.11 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/EntityClassInfo.java 28 Mar 2008 17:00:34 -0000 @@ -38,7 +38,6 @@ * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. */ - package org.netbeans.modules.websvc.rest.codegen.model; import org.netbeans.modules.websvc.rest.support.*; @@ -49,9 +48,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; @@ -64,6 +62,8 @@ import org.netbeans.api.java.source.JavaSource.Phase; import org.netbeans.api.project.Project; import org.netbeans.modules.j2ee.persistence.api.metadata.orm.Entity; +import org.netbeans.modules.websvc.rest.wizard.Util; +import org.openide.util.Exceptions; /** * @@ -72,7 +72,8 @@ public class EntityClassInfo { private EntityResourceModelBuilder builder; - private Entity entity; + private final Entity entity; + private JavaSource entitySource; private String name; private String type; private String packageName; @@ -80,8 +81,9 @@ private FieldInfo idFieldInfo; /** Creates a new instance of ClassInfo */ - public EntityClassInfo(Entity entity, Project project, EntityResourceModelBuilder builder) { + public EntityClassInfo(Entity entity, Project project, EntityResourceModelBuilder builder, JavaSource source) { this.entity = entity; + this.entitySource = source; this.fieldInfos = new ArrayList(); this.builder = builder; @@ -92,9 +94,21 @@ } } - private void extractFields(Project project) { + protected void setPackageName(String packageName) { + this.packageName = packageName; + } + + protected void setName(String name) { + this.name = name; + } + + protected void setType(String type) { + this.type = type; + } + + protected void extractFields(Project project) { try { - final JavaSource source = SourceGroupSupport.getJavaSourceFromClassName(entity.getClass2(), project); + final JavaSource source = entitySource; source.runUserActionTask(new AbstractTask() { public void run(CompilationController controller) throws IOException { @@ -107,7 +121,17 @@ type = packageName + "." + name; TypeElement classElement = JavaSourceHelper.getTopLevelClassElement(controller); - List fields = ElementFilter.fieldsIn(classElement.getEnclosedElements()); + extractFields(classElement); + extractFieldsFromMethods(classElement); + } + }, true); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + + protected void extractFields(TypeElement typeElement) { + List fields = ElementFilter.fieldsIn(typeElement.getEnclosedElements()); for (VariableElement field : fields) { Set modifiers = field.getModifiers(); @@ -117,6 +141,12 @@ FieldInfo fieldInfo = new FieldInfo(); + for (AnnotationMirror annotation : field.getAnnotationMirrors()) { + fieldInfo.addAnnotation(annotation.toString()); + } + + if (!fieldInfo.isPersistent()) continue; + fieldInfos.add(fieldInfo); fieldInfo.setName(field.getSimpleName().toString()); @@ -134,32 +164,79 @@ fieldInfo.setType(fieldType.toString()); } + if (fieldInfo.isId()) { + idFieldInfo = fieldInfo; + } + } + } + + protected void extractFieldsFromMethods(TypeElement typeElement) { + List methods = ElementFilter.methodsIn(typeElement.getEnclosedElements()); + + for (ExecutableElement method : methods) { + Set modifiers = method.getModifiers(); + if (modifiers.contains(Modifier.STATIC)) { + continue; + } + + FieldInfo fieldInfo = new FieldInfo(); - for (AnnotationMirror annotation : field.getAnnotationMirrors()) { + for (AnnotationMirror annotation : method.getAnnotationMirrors()) { fieldInfo.addAnnotation(annotation.toString()); } - if (fieldInfo.isId()) { - idFieldInfo = fieldInfo; + if (!fieldInfo.isPersistent()) continue; + + fieldInfos.add(fieldInfo); + String name = method.getSimpleName().toString(); + if (name.startsWith("get")) { //NOI18N + name = name.substring(3); + name = Util.lowerFirstChar(name); + } + fieldInfo.setName(name); + + TypeMirror returnType = method.getReturnType(); + + if (returnType.getKind() == TypeKind.DECLARED) { + DeclaredType declType = (DeclaredType) returnType; + + fieldInfo.setType(declType.asElement().toString()); + + for (TypeMirror arg : declType.getTypeArguments()) { + fieldInfo.setTypeArg(arg.toString()); } + } else { + fieldInfo.setType(returnType.toString()); } + + if (fieldInfo.isId()) { + idFieldInfo = fieldInfo; } - }, true); - } catch (IOException ex) { - Logger.getLogger(getClass().getName()).log(Level.INFO, ex.getLocalizedMessage(), ex); } } - private void extractPKFields(Project project) { + protected void extractPKFields(Project project) { try { - final JavaSource source = SourceGroupSupport.getJavaSourceFromClassName(idFieldInfo.getType(), project); - source.runUserActionTask(new AbstractTask() { + JavaSource pkSource = SourceGroupSupport.getJavaSourceFromClassName(idFieldInfo.getType(), project); + if (pkSource == null) { + throw new IllegalArgumentException("No java source for "+idFieldInfo.getType()); + } + pkSource.runUserActionTask(new AbstractTask() { public void run(CompilationController controller) throws IOException { controller.toPhase(Phase.RESOLVED); TypeElement classElement = JavaSourceHelper.getTopLevelClassElement(controller); - List fields = ElementFilter.fieldsIn(classElement.getEnclosedElements()); + extractPKFields(classElement); + } + }, true); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + + protected void extractPKFields(TypeElement typeElement) { + List fields = ElementFilter.fieldsIn(typeElement.getEnclosedElements()); for (VariableElement field : fields) { Set modifiers = field.getModifiers(); @@ -187,11 +264,6 @@ } } } - }, true); - } catch (IOException ex) { - Logger.getLogger(getClass().getName()).log(Level.INFO, ex.getLocalizedMessage(), ex); - } - } public Entity getEntity() { return entity; @@ -317,12 +389,18 @@ this.annotations.add(annotation); } + public boolean isPersistent() { + return matchAnnotation("@javax.persistence.Column") || isRelationship() || isId(); + } + public boolean isId() { return matchAnnotation("@javax.persistence.Id") || matchAnnotation("@javax.persistence.EmbeddedId"); //NOI18N + } public boolean isEmbeddedId() { return matchAnnotation("@javax.persistence.EmbeddedId"); //NOI18N + } public boolean isRelationship() { @@ -331,18 +409,22 @@ public boolean isOneToOne() { return matchAnnotation("@javax.persistence.OneToOne"); //NOI18N + } public boolean isOneToMany() { return matchAnnotation("@javax.persistence.OneToMany"); //NOI18N + } public boolean isManyToOne() { return matchAnnotation("@javax.persistence.ManyToOne"); //NOI18N + } public boolean isManyToMany() { return matchAnnotation("@javax.persistence.ManyToMany"); //NOI18N + } private boolean matchAnnotation(String annotation) { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/EntityResourceModelBuilder.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/Attic/EntityResourceModelBuilder.java,v retrieving revision 1.3 diff -u -r1.3 EntityResourceModelBuilder.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/EntityResourceModelBuilder.java 30 Oct 2007 20:32:54 -0000 1.3 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/EntityResourceModelBuilder.java 28 Mar 2008 17:00:34 -0000 @@ -41,7 +41,9 @@ package org.netbeans.modules.websvc.rest.codegen.model; -import org.netbeans.modules.websvc.rest.codegen.model.EntityClassInfo; +import org.openide.util.Exceptions; + +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -49,13 +51,12 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; +import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.project.Project; import org.netbeans.modules.j2ee.persistence.api.metadata.orm.Entity; import org.netbeans.modules.websvc.rest.codegen.model.EntityResourceBean.Type; -import org.netbeans.modules.websvc.rest.codegen.model.EntityClassInfo; import org.netbeans.modules.websvc.rest.codegen.model.EntityClassInfo.FieldInfo; +import org.netbeans.modules.websvc.rest.support.SourceGroupSupport; import org.netbeans.modules.websvc.rest.wizard.Util; /** @@ -70,8 +71,20 @@ public EntityResourceModelBuilder(Project project, Collection entities) { entityClassInfoMap = new HashMap(); for (Entity entity : entities) { - EntityClassInfo info = new EntityClassInfo(entity, project, this); - entityClassInfoMap.put(entity.getClass2(), info); + try { + EntityClassInfo info = null; + JavaSource js = SourceGroupSupport.getJavaSourceFromClassName(entity.getClass2(), project); + if (js != null) { + info = new EntityClassInfo(entity, project, this, js); + } else if (entity instanceof RuntimeJpaEntity) { + info = new RuntimeEntityClassInfo((RuntimeJpaEntity)entity, project, this); + } + if (info != null) { + entityClassInfoMap.put(entity.getClass2(), info); + } + } catch(IOException ioe) { + Exceptions.printStackTrace(ioe); + } } } @@ -106,7 +119,7 @@ model.setValid(true); } catch (Exception ex) { - Logger.getLogger(getClass().getName()).log(Level.ALL, "build", ex); + Exceptions.printStackTrace(ex); model.setValid(false); } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeEntityClassInfo.java =================================================================== RCS file: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeEntityClassInfo.java diff -N websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeEntityClassInfo.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeEntityClassInfo.java 28 Mar 2008 17:00:34 -0000 @@ -0,0 +1,89 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2008 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.websvc.rest.codegen.model; + +import org.netbeans.api.project.Project; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.Entity; + +/** + * + * @author nam + */ +public class RuntimeEntityClassInfo extends EntityClassInfo { + + public RuntimeEntityClassInfo(RuntimeJpaEntity entity, Project project, + EntityResourceModelBuilder builder) { + + super(entity, project, builder, null); + setName(getName(entity)); + setPackageName(getPackageName(entity)); + setType(getType(entity)); + } + + static String getName(RuntimeJpaEntity entity) { + return entity.getTypeElement().getSimpleName().toString(); + } + + static String getPackageName(RuntimeJpaEntity entity) { + String name = getName(entity); + String qualified = entity.getTypeElement().getQualifiedName().toString(); + String pack = qualified.substring(0, qualified.length()-name.length()-1); + return pack; + } + + static String getType(RuntimeJpaEntity entity) { + return entity.getTypeElement().getQualifiedName().toString(); + } + + @Override + protected void extractFields(Project project) { + super.extractFields(getEntity().getTypeElement()); + } + + @Override + protected void extractPKFields(Project project) { + super.extractPKFields(getEntity().getTypeElement()); + } + + @Override + public RuntimeJpaEntity getEntity() { + return (RuntimeJpaEntity) super.getEntity(); + } +} Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeJpaEntity.java =================================================================== RCS file: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeJpaEntity.java diff -N websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeJpaEntity.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/RuntimeJpaEntity.java 28 Mar 2008 17:00:35 -0000 @@ -0,0 +1,619 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2008 Sun Microsystems, Inc. + */ +package org.netbeans.modules.websvc.rest.codegen.model; + +import java.lang.annotation.Annotation; +import java.util.HashSet; +import org.netbeans.modules.websvc.rest.support.*; +import java.util.List; +import java.util.Set; +import javax.lang.model.element.TypeElement; +import org.netbeans.api.java.source.ClasspathInfo; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.SourceGroup; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.AssociationOverride; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.AttributeOverride; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.Attributes; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.DiscriminatorColumn; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.EmptyType; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.Entity; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityListeners; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.IdClass; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.Inheritance; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.NamedNativeQuery; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.NamedQuery; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostLoad; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostPersist; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostRemove; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostUpdate; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PrePersist; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PreRemove; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PreUpdate; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.PrimaryKeyJoinColumn; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.SecondaryTable; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.SequenceGenerator; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.SqlResultSetMapping; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.Table; +import org.netbeans.modules.j2ee.persistence.api.metadata.orm.TableGenerator; +import org.netbeans.modules.websvc.rest.codegen.Constants; +import org.netbeans.modules.websvc.rest.wizard.Util; + +/** + * + * @author nam + */ +public class RuntimeJpaEntity implements Entity { + + private TypeElement typeElement; + private String name; + + public RuntimeJpaEntity(TypeElement typeElement, String entityName) { + this.typeElement = typeElement; + this.name = entityName; + } + + public TypeElement getTypeElement() { + return typeElement; + } + + public String getName() { + return name; + } + + public String getClass2() { + return typeElement.getQualifiedName().toString(); + } + + public int addAssociationOverride(AssociationOverride value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int addAttributeOverride(AttributeOverride value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int addNamedNativeQuery(NamedNativeQuery value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int addNamedQuery(NamedQuery value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int addPrimaryKeyJoinColumn(PrimaryKeyJoinColumn value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int addSecondaryTable(SecondaryTable value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int addSqlResultSetMapping(SqlResultSetMapping value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getAccess() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public AssociationOverride getAssociationOverride(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public AssociationOverride[] getAssociationOverride() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public AttributeOverride getAttributeOverride(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public AttributeOverride[] getAttributeOverride() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Attributes getAttributes() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getDescription() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public DiscriminatorColumn getDiscriminatorColumn() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getDiscriminatorValue() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public EntityListeners getEntityListeners() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public EmptyType getExcludeDefaultListeners() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public EmptyType getExcludeSuperclassListeners() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public IdClass getIdClass() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Inheritance getInheritance() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public NamedNativeQuery getNamedNativeQuery(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public NamedNativeQuery[] getNamedNativeQuery() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public NamedQuery getNamedQuery(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public NamedQuery[] getNamedQuery() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostLoad getPostLoad() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostPersist getPostPersist() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostRemove getPostRemove() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostUpdate getPostUpdate() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PrePersist getPrePersist() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PreRemove getPreRemove() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PreUpdate getPreUpdate() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PrimaryKeyJoinColumn getPrimaryKeyJoinColumn(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PrimaryKeyJoinColumn[] getPrimaryKeyJoinColumn() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SecondaryTable getSecondaryTable(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SecondaryTable[] getSecondaryTable() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SequenceGenerator getSequenceGenerator() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SqlResultSetMapping getSqlResultSetMapping(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SqlResultSetMapping[] getSqlResultSetMapping() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Table getTable() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public TableGenerator getTableGenerator() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isMetadataComplete() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public AssociationOverride newAssociationOverride() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public AttributeOverride newAttributeOverride() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Attributes newAttributes() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public DiscriminatorColumn newDiscriminatorColumn() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public EmptyType newEmptyType() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public EntityListeners newEntityListeners() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public IdClass newIdClass() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Inheritance newInheritance() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public NamedNativeQuery newNamedNativeQuery() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public NamedQuery newNamedQuery() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostLoad newPostLoad() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostPersist newPostPersist() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostRemove newPostRemove() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PostUpdate newPostUpdate() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PrePersist newPrePersist() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PreRemove newPreRemove() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PreUpdate newPreUpdate() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PrimaryKeyJoinColumn newPrimaryKeyJoinColumn() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SecondaryTable newSecondaryTable() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SequenceGenerator newSequenceGenerator() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public SqlResultSetMapping newSqlResultSetMapping() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Table newTable() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public TableGenerator newTableGenerator() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int removeAssociationOverride(AssociationOverride value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int removeAttributeOverride(AttributeOverride value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int removeNamedNativeQuery(NamedNativeQuery value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int removeNamedQuery(NamedQuery value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int removePrimaryKeyJoinColumn(PrimaryKeyJoinColumn value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int removeSecondaryTable(SecondaryTable value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int removeSqlResultSetMapping(SqlResultSetMapping value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAccess(String value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAssociationOverride(int index, AssociationOverride value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAssociationOverride(AssociationOverride[] value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAttributeOverride(int index, AttributeOverride value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAttributeOverride(AttributeOverride[] value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAttributes(Attributes value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setClass2(String value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setDescription(String value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setDiscriminatorColumn(DiscriminatorColumn value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setDiscriminatorValue(String value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setEntityListeners(EntityListeners value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setExcludeDefaultListeners(EmptyType value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setExcludeSuperclassListeners(EmptyType value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setIdClass(IdClass value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setInheritance(Inheritance value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setMetadataComplete(boolean value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setName(String value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setNamedNativeQuery(int index, NamedNativeQuery value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setNamedNativeQuery(NamedNativeQuery[] value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setNamedQuery(int index, NamedQuery value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setNamedQuery(NamedQuery[] value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPostLoad(PostLoad value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPostPersist(PostPersist value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPostRemove(PostRemove value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPostUpdate(PostUpdate value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPrePersist(PrePersist value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPreRemove(PreRemove value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPreUpdate(PreUpdate value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPrimaryKeyJoinColumn(int index, PrimaryKeyJoinColumn value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setPrimaryKeyJoinColumn(PrimaryKeyJoinColumn[] value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setSecondaryTable(int index, SecondaryTable value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setSecondaryTable(SecondaryTable[] value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setSequenceGenerator(SequenceGenerator value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setSqlResultSetMapping(int index, SqlResultSetMapping value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setSqlResultSetMapping(SqlResultSetMapping[] value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setTable(Table value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setTableGenerator(TableGenerator value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int sizeAssociationOverride() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int sizeAttributeOverride() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int sizeNamedNativeQuery() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int sizeNamedQuery() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int sizePrimaryKeyJoinColumn() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int sizeSecondaryTable() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int sizeSqlResultSetMapping() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public static Set getEntityFromClasspath(Project project) { + SourceGroup[] sgs = SourceGroupSupport.getJavaSourceGroups(project); + + Set result = new HashSet(); + if (sgs == null || sgs.length < 1) { + return result; + } + + ClasspathInfo cpi = ClasspathInfo.create(sgs[0].getRootFolder()); + List entityElements = TypeUtil.getAnnotatedTypeElementsFromClasspath( + cpi, + Constants.PERSISTENCE_ENTITY); + + for (TypeElement te : entityElements) { + String entityName = null; + Class entityClass = Util.getType(project, te.getQualifiedName().toString()); + if (entityClass != null) { + Annotation annotation = TypeUtil.getJpaTableAnnotation(entityClass); + if (annotation != null) { + entityName = TypeUtil.getAnnotationValueName(annotation); + } + if (entityName == null) { + annotation = TypeUtil.getJpaEntityAnnotation(entityClass); + entityName = TypeUtil.getAnnotationValueName(annotation); + } + } + if (entityName == null) { + entityName = te.getSimpleName().toString(); + } + result.add(new RuntimeJpaEntity(te, entityName)); + } + return result; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (! (obj instanceof Entity)) { + return false; + } + final Entity other = (Entity) obj; + return getClass2().equals(other.getClass2()); + } + + @Override + public int hashCode() { + int hash = 5; + return hash; + } + +} Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/TypeUtil.java =================================================================== RCS file: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/TypeUtil.java diff -N websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/TypeUtil.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/model/TypeUtil.java 28 Mar 2008 17:00:35 -0000 @@ -0,0 +1,274 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2008 Sun Microsystems, Inc. + */ +package org.netbeans.modules.websvc.rest.codegen.model; + +import java.io.IOException; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.TypeElement; +import org.netbeans.api.java.source.ClassIndex; +import org.netbeans.api.java.source.ClassIndex.NameKind; +import org.netbeans.api.java.source.ClasspathInfo; +import org.netbeans.api.java.source.CompilationController; +import org.netbeans.api.java.source.ElementHandle; +import org.netbeans.api.java.source.JavaSource; +import org.netbeans.api.java.source.JavaSource.Phase; +import org.netbeans.api.java.source.Task; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.SourceGroup; +import org.netbeans.modules.websvc.rest.codegen.Constants; +import org.netbeans.modules.websvc.rest.support.JavaSourceHelper; +import org.netbeans.modules.websvc.rest.support.SourceGroupSupport; +import org.netbeans.modules.websvc.rest.wizard.Util; +import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; + +/** + * + * @author nam + */ +public class TypeUtil { + + public static final String AN_KEY_NAME = "name"; + + public static List getClassAnnotations(Class type) { + List result = new ArrayList(Arrays.asList(type.getAnnotations())); + return result; + } + + public static boolean isXmlRoot(Class type) { + for (Annotation ann : type.getAnnotations()) { + String annType = ann.annotationType().getName(); + if (annType.equals(Constants.XML_ROOT_ELEMENT)) { + return true; + } + } + return false; + } + + public static Annotation getXmlElementAnnotation(Method m) { + for (Annotation ann : m.getAnnotations()) { + if (ann.annotationType().getName().equals(Constants.XML_ELEMENT)) { + return ann; + } + } + return null; + } + + public static Annotation getXmlAttributeAnnotation(Field f) { + for (Annotation ann : f.getAnnotations()) { + if (ann.annotationType().getName().equals(Constants.XML_ATTRIBUTE)) { + return ann; + } + } + return null; + } + + public static Annotation getXmlAttributeAnnotation(Method m) { + for (Annotation ann : m.getAnnotations()) { + if (ann.annotationType().getName().equals(Constants.XML_ATTRIBUTE)) { + return ann; + } + } + return null; + } + + public static Annotation getXmlElementAnnotation(Field f) { + for (Annotation ann : f.getAnnotations()) { + if (ann.annotationType().getName().equals(Constants.XML_ELEMENT)) { + return ann; + } + } + return null; + } + + public static List getFieldAnnotations(Class type) { + List result = new ArrayList(); + for (Field f : type.getDeclaredFields()) { + result.addAll(Arrays.asList(f.getAnnotations())); + } + return result; + } + + public static List getMethodAnnotations(Class type) { + List result = new ArrayList(); + for (Method m : type.getDeclaredMethods()) { + result.addAll(Arrays.asList(m.getAnnotations())); + } + return result; + } + + public static List getAnnotations(Class type, boolean deep) { + List result = getFieldAnnotations(type); + result.addAll(getMethodAnnotations(type)); + result.addAll(getClassAnnotations(type)); + if (deep) { + for (Class c : type.getDeclaredClasses()) { + result.addAll(getAnnotations(c, deep)); + } + } + return result; + } + + public static Map getSimpleAnnotationValues(Annotation annotation) { + Map result = new HashMap(); + String value = annotation.toString(); + int begin = value.indexOf('(') + 1; + int end = value.lastIndexOf(')'); + value = value.substring(begin, end); + String[] pairs = value.split(","); + for (String s : pairs) { + String pair[] = s.split("="); + if (pair.length == 2) { + result.put(pair[0], pair[1]); + } + } + return result; + } + + public static String getAnnotationValueName(Annotation annotation) { + return getSimpleAnnotationValues(annotation).get(AN_KEY_NAME); + } + + public static String getQualifiedClassName(String simpleName, JavaSource context) throws IOException { + final String suffix = "." + simpleName; + final String[] found = new String[1]; + + context.runUserActionTask(new Task() { + + public void run(CompilationController controller) throws Exception { + controller.toPhase(Phase.RESOLVED); + for (String imp : JavaSourceHelper.getImports(controller)) { + if (imp.endsWith(suffix)) { + found[0] = imp; + break; + } + } + } + }, true); + + return found[0]; + } + + public static Class getClass(String name, JavaSource context, Project project) throws IOException { + if (name.indexOf('.') > 0) { + return Util.getType(project, name); + } else { + String qualifiedName = getQualifiedClassName(name, context); + if (qualifiedName != null) { + return Util.getType(project, qualifiedName); + } + } + return null; + } + + public static List getAnnotatedTypeElementsFromClasspath( + final ClasspathInfo cpi, final String annotationType) { + + final List result = new ArrayList(); + JavaSource source = JavaSource.create(cpi, new FileObject[0]); + final Set> handles[] = new Set[1]; + try { + source.runUserActionTask(new Task() { + + public void run(CompilationController controller) throws Exception { + handles[0] = cpi.getClassIndex().getDeclaredTypes("\\w*", NameKind.REGEXP, EnumSet.of(ClassIndex.SearchScope.DEPENDENCIES)); + if (handles[0] != null) { + for (ElementHandle h : handles[0]) { + String qn = h.getQualifiedName(); + if (qn.startsWith("java.") || + h.getQualifiedName().startsWith("javax.") || + h.getQualifiedName().startsWith("sun.") || + h.getQualifiedName().startsWith("com.sun.") || + h.getQualifiedName().startsWith("org.apache.") || + h.getQualifiedName().startsWith("org.netbeans.")) { + continue; + } + TypeElement te = h.resolve(controller); + if (te == null) { + continue; + } + for (AnnotationMirror am : te.getAnnotationMirrors()) { + if (am.getAnnotationType().toString().equals(annotationType)) { + result.add(te); + } + } + } + } + } + }, true); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + return result; + } + + public static List getAnnotatedTypeElementsFromClasspath(Project project, String annotationType) { + SourceGroup[] sgs = SourceGroupSupport.getJavaSourceGroups(project); + ClasspathInfo cpi = ClasspathInfo.create(sgs[0].getRootFolder()); + return getAnnotatedTypeElementsFromClasspath(cpi, annotationType); + } + + public static Annotation getJpaTableAnnotation(Class c) { + for (Annotation ann : c.getAnnotations()) { + if (ann.annotationType().getName().equals(Constants.PERSISTENCE_TABLE)) { + return ann; + } + } + return null; + } + + public static Annotation getJpaEntityAnnotation(Class c) { + for (Annotation ann : c.getAnnotations()) { + if (ann.annotationType().getName().equals(Constants.PERSISTENCE_ENTITY)) { + return ann; + } + } + return null; + } +} Index: websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/resources/UriResolver.template =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/resources/Attic/UriResolver.template,v retrieving revision 1.9 diff -u -r1.9 UriResolver.template --- websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/resources/UriResolver.template 13 Jul 2007 01:43:18 -0000 1.9 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/codegen/resources/UriResolver.template 28 Mar 2008 17:00:35 -0000 @@ -18,7 +18,7 @@ /** * Utility class for resolving an uri into an entity. - + * * @author __USER__ */ public class UriResolver { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/HttpMethodsChildren.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/Attic/HttpMethodsChildren.java,v retrieving revision 1.10 diff -u -r1.10 HttpMethodsChildren.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/HttpMethodsChildren.java 2 Nov 2007 06:30:30 -0000 1.10 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/HttpMethodsChildren.java 28 Mar 2008 17:00:35 -0000 @@ -57,6 +57,7 @@ import org.netbeans.modules.websvc.rest.model.api.RestServices; import org.netbeans.modules.websvc.rest.model.api.RestServicesMetadata; import org.netbeans.modules.websvc.rest.model.api.RestServicesModel; +import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; @@ -92,7 +93,7 @@ } }); } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } updateKeys(); @@ -108,7 +109,7 @@ } }); } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } setKeys(Collections.EMPTY_SET); @@ -135,7 +136,7 @@ } }); } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } setKeys(Utils.sortKeys(keys)); @@ -164,7 +165,7 @@ return nodes; } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } return new Node[0]; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/OpenCookieFactory.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/Attic/OpenCookieFactory.java,v retrieving revision 1.3 diff -u -r1.3 OpenCookieFactory.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/OpenCookieFactory.java 30 Oct 2007 20:32:27 -0000 1.3 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/OpenCookieFactory.java 28 Mar 2008 17:00:35 -0000 @@ -46,12 +46,12 @@ import org.netbeans.api.project.Project; import org.netbeans.modules.websvc.rest.support.JavaSourceHelper; import org.netbeans.modules.websvc.rest.support.SourceGroupSupport; -import org.openide.ErrorManager; import org.openide.cookies.LineCookie; import org.openide.cookies.OpenCookie; import org.openide.filesystems.FileObject; import org.openide.loaders.DataObject; import org.openide.text.Line; +import org.openide.util.Exceptions; /** * @@ -70,7 +70,7 @@ return new OpenCookieImpl(source, className, methodName); } catch (IOException ex) { - ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, ex.toString()); + Exceptions.printStackTrace(ex); } return null; @@ -86,7 +86,7 @@ try { dataObj = DataObject.find(source); } catch (Exception de) { - ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, de.toString()); + Exceptions.printStackTrace(de); } javaSource = JavaSource.forFileObject(source); Index: websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesChildren.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/Attic/RestServicesChildren.java,v retrieving revision 1.10 diff -u -r1.10 RestServicesChildren.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesChildren.java 14 Jan 2008 17:49:42 -0000 1.10 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesChildren.java 28 Mar 2008 17:00:35 -0000 @@ -56,6 +56,7 @@ import org.netbeans.modules.websvc.rest.model.api.RestServicesMetadata; import org.netbeans.modules.websvc.rest.model.api.RestServicesModel; import org.netbeans.modules.websvc.rest.spi.RestSupport; +import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; @@ -98,7 +99,7 @@ }); } } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } updateKeys(); @@ -118,7 +119,7 @@ }); } } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } setKeys(Collections.EMPTY_SET); @@ -144,7 +145,7 @@ }); } } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } setKeys(Utils.sortKeys(keys)); @@ -171,7 +172,7 @@ return nodes; } } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } return new Node[0]; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesNodeFactory.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/Attic/RestServicesNodeFactory.java,v retrieving revision 1.8 diff -u -r1.8 RestServicesNodeFactory.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesNodeFactory.java 14 Jan 2008 17:49:42 -0000 1.8 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesNodeFactory.java 28 Mar 2008 17:00:35 -0000 @@ -59,6 +59,7 @@ import org.netbeans.spi.project.ui.support.NodeFactory; import org.netbeans.spi.project.ui.support.NodeList; import org.openide.nodes.Node; +import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; /** @@ -111,7 +112,7 @@ } }); } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } return result; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/SubResourceLocatorsChildren.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/Attic/SubResourceLocatorsChildren.java,v retrieving revision 1.10 diff -u -r1.10 SubResourceLocatorsChildren.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/SubResourceLocatorsChildren.java 2 Nov 2007 06:30:27 -0000 1.10 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/nodes/SubResourceLocatorsChildren.java 28 Mar 2008 17:00:35 -0000 @@ -57,6 +57,7 @@ import org.netbeans.modules.websvc.rest.model.api.RestServicesMetadata; import org.netbeans.modules.websvc.rest.model.api.RestServicesModel; import org.netbeans.modules.websvc.rest.model.api.SubResourceLocator; +import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; @@ -91,7 +92,7 @@ } }); } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } updateKeys(); @@ -107,7 +108,7 @@ } }); } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } setKeys(Collections.EMPTY_SET); @@ -134,7 +135,7 @@ } }); } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } setKeys(Utils.sortKeys(keys)); @@ -163,7 +164,7 @@ return nodes; } catch (IOException ex) { - + Exceptions.printStackTrace(ex); } return new Node[0]; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/projects/ProjectTestRestServicesAction.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/projects/Attic/ProjectTestRestServicesAction.java,v retrieving revision 1.2 diff -u -r1.2 ProjectTestRestServicesAction.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/projects/ProjectTestRestServicesAction.java 30 Oct 2007 20:32:47 -0000 1.2 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/projects/ProjectTestRestServicesAction.java 28 Mar 2008 17:00:35 -0000 @@ -46,8 +46,6 @@ import java.io.File; import java.io.IOException; import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.Icon; @@ -56,7 +54,6 @@ import org.netbeans.api.project.Project; import org.netbeans.modules.websvc.rest.spi.RestSupport; import org.netbeans.modules.websvc.rest.support.Utils; -import org.netbeans.spi.project.ActionProvider; import org.netbeans.spi.project.support.ant.AntProjectHelper; import org.netbeans.spi.project.support.ant.EditableProperties; import org.netbeans.spi.project.ui.support.ProjectActionPerformer; @@ -151,7 +148,7 @@ p.setProperty(RestSupport.PROP_RESTBEANS_TEST_URL, testFO.getURL().toString()); p.setProperty(RestSupport.PROP_RESTBEANS_TEST_FILE, FileUtil.toFile(testFO).getAbsolutePath()); } catch(Exception ex) { - Logger.getLogger("global").log(Level.INFO, null, ex); + Exceptions.printStackTrace(ex); } return p; } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/projects/WebProjectRestSupport.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/projects/Attic/WebProjectRestSupport.java,v retrieving revision 1.8 diff -u -r1.8 WebProjectRestSupport.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/projects/WebProjectRestSupport.java 14 Jan 2008 21:41:20 -0000 1.8 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/projects/WebProjectRestSupport.java 28 Mar 2008 17:00:35 -0000 @@ -44,8 +44,6 @@ import java.io.IOException; import java.math.BigInteger; import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectManager; @@ -62,6 +60,7 @@ import org.netbeans.modules.web.spi.webmodule.WebModuleProvider; import org.netbeans.modules.websvc.rest.spi.RestSupport; import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; /** * @@ -172,7 +171,7 @@ try { return hasRestServletAdaptor(getWebApp()); } catch(IOException ioe) { - Logger.getLogger("global").log(Level.INFO, null, ioe); + Exceptions.printStackTrace(ioe); return false; } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/projects/WebRestSupportLookupProvider.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/projects/Attic/WebRestSupportLookupProvider.java,v retrieving revision 1.21 diff -u -r1.21 WebRestSupportLookupProvider.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/projects/WebRestSupportLookupProvider.java 14 Jan 2008 19:29:34 -0000 1.21 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/projects/WebRestSupportLookupProvider.java 28 Mar 2008 17:00:36 -0000 @@ -41,21 +41,10 @@ package org.netbeans.modules.websvc.rest.projects; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; import org.netbeans.api.project.Project; -import org.netbeans.modules.j2ee.metadata.model.api.MetadataModelAction; -import org.netbeans.modules.websvc.rest.RestUtils; -import org.netbeans.modules.websvc.rest.model.api.RestServices; -import org.netbeans.modules.websvc.rest.model.api.RestServicesMetadata; -import org.netbeans.modules.websvc.rest.model.api.RestServicesModel; import org.netbeans.modules.websvc.rest.spi.RestSupport; import org.netbeans.spi.project.LookupProvider; import org.netbeans.spi.project.ui.PrivilegedTemplates; -import org.netbeans.spi.project.ui.ProjectOpenedHook; import org.openide.util.Lookup; import org.openide.util.lookup.Lookups; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/resources/layer.xml =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/resources/Attic/layer.xml,v retrieving revision 1.47 diff -u -r1.47 layer.xml --- websvc/rest/src/org/netbeans/modules/websvc/rest/resources/layer.xml 6 Dec 2007 06:50:29 -0000 1.47 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/resources/layer.xml 28 Mar 2008 17:00:36 -0000 @@ -45,6 +45,7 @@ + @@ -112,7 +113,7 @@ - + @@ -130,7 +131,7 @@ - + Index: websvc/rest/src/org/netbeans/modules/websvc/rest/support/JavaSourceHelper.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/support/Attic/JavaSourceHelper.java,v retrieving revision 1.52 diff -u -r1.52 JavaSourceHelper.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/support/JavaSourceHelper.java 17 Jan 2008 09:20:56 -0000 1.52 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/support/JavaSourceHelper.java 28 Mar 2008 17:00:36 -0000 @@ -47,7 +47,6 @@ import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.ImportTree; -import com.sun.source.tree.MethodTree; import com.sun.source.tree.ModifiersTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; @@ -58,7 +57,6 @@ import java.util.List; import java.io.IOException; import java.util.ArrayList; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; @@ -93,7 +91,6 @@ import org.netbeans.api.project.SourceGroup; import org.netbeans.modules.websvc.rest.codegen.Constants; import org.netbeans.modules.websvc.rest.model.api.RestConstants; -import org.openide.ErrorManager; import org.openide.cookies.SaveCookie; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileSystem; @@ -101,6 +98,7 @@ import org.openide.loaders.DataFolder; import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectNotFoundException; +import org.openide.util.Exceptions; import org.openide.util.Parameters; /** @@ -174,6 +172,7 @@ } }, true); } catch (IOException ex) { + Exceptions.printStackTrace(ex); } return isBoolean[0]; @@ -194,7 +193,12 @@ } public static String getClassName(JavaSource source) throws IOException { - return getTypeElement(source).getSimpleName().toString(); + TypeElement te = getTypeElement(source); + if (te != null) { + return te.getSimpleName().toString(); + } else { + return null; + } } public static String getClassType(JavaSource source) throws IOException { @@ -214,6 +218,7 @@ } }, true); } catch (IOException ex) { + Exceptions.printStackTrace(ex); } return packageName[0]; @@ -244,6 +249,7 @@ } }, true); } catch (IOException ex) { + Exceptions.printStackTrace(ex); } return fieldName[0]; @@ -351,7 +357,7 @@ } return JavaSource.forFileObject(fobj); } catch (IOException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } return null; @@ -839,6 +845,7 @@ } }, true); } catch (IOException ex) { + Exceptions.printStackTrace(ex); } return classAnons[0]; @@ -859,7 +866,7 @@ } }, true); } catch (IOException ex) { - ex.printStackTrace(); + Exceptions.printStackTrace(ex); } return allTree[0]; } @@ -880,6 +887,7 @@ } }, true); } catch (IOException ex) { + Exceptions.printStackTrace(ex); } return allMethods; } @@ -908,6 +916,7 @@ } }, true); } catch (IOException ex) { + Exceptions.printStackTrace(ex); } return results; @@ -949,6 +958,7 @@ } }, true); } catch (IOException ex) { + Exceptions.printStackTrace(ex); } return position; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/support/PersistenceHelper.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/support/Attic/PersistenceHelper.java,v retrieving revision 1.11 diff -u -r1.11 PersistenceHelper.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/support/PersistenceHelper.java 30 Oct 2007 20:32:42 -0000 1.11 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/support/PersistenceHelper.java 28 Mar 2008 17:00:36 -0000 @@ -56,14 +56,11 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.project.Project; -import org.netbeans.modules.websvc.rest.codegen.model.EntityClassInfo; -import org.netbeans.modules.websvc.rest.codegen.model.EntityResourceBeanModel; import org.netbeans.modules.websvc.rest.spi.RestSupport; -import org.openide.ErrorManager; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; @@ -232,13 +229,13 @@ //transformer.transform(source, new StreamResult(System.out)); } catch (Exception ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } finally { if (os != null) { try { os.close(); } catch (IOException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } } @@ -265,15 +262,15 @@ is = fobj.getInputStream(); document = builder.parse(is); } catch (SAXException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } catch (IOException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } finally { if (is != null) { try { is.close(); } catch (IOException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } } @@ -302,7 +299,7 @@ builder = factory.newDocumentBuilder(); builder.setEntityResolver(new SunWebDTDResolver()); } catch (ParserConfigurationException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } return builder; Index: websvc/rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/support/Attic/SourceGroupSupport.java,v retrieving revision 1.14 diff -u -r1.14 SourceGroupSupport.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java 18 Jan 2008 05:02:44 -0000 1.14 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/support/SourceGroupSupport.java 28 Mar 2008 17:00:36 -0000 @@ -135,7 +135,8 @@ public static SourceGroup findSourceGroupForFile(SourceGroup[] sourceGroups, FileObject folder) { for (int i = 0; i < sourceGroups.length; i++) { - if (FileUtil.isParentOf(sourceGroups[i].getRootFolder(), folder)) { + if (FileUtil.isParentOf(sourceGroups[i].getRootFolder(), folder) || + sourceGroups[i].getRootFolder().equals(folder)) { return sourceGroups[i]; } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/support/Utils.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/support/Attic/Utils.java,v retrieving revision 1.7 diff -u -r1.7 Utils.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/support/Utils.java 30 Oct 2007 20:32:44 -0000 1.7 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/support/Utils.java 28 Mar 2008 17:00:36 -0000 @@ -52,13 +52,13 @@ import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.api.project.Project; -import org.netbeans.modules.websvc.api.jaxws.project.GeneratedFilesHelper; -import org.openide.ErrorManager; +import org.netbeans.spi.project.support.ant.GeneratedFilesHelper; import org.openide.cookies.LineCookie; import org.openide.cookies.SaveCookie; import org.openide.filesystems.FileObject; import org.openide.loaders.DataObject; import org.openide.text.Line; +import org.openide.util.Exceptions; import org.openide.util.Lookup; /** @@ -114,8 +114,7 @@ }); } } catch (Exception de) { - de.printStackTrace(); - ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, de.toString()); + Exceptions.printStackTrace(de); } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Bundle.properties =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/Bundle.properties,v retrieving revision 1.55.2.1 diff -u -r1.55.2.1 Bundle.properties --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Bundle.properties 22 Jan 2008 18:45:24 -0000 1.55.2.1 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Bundle.properties 28 Mar 2008 17:00:37 -0000 @@ -134,13 +134,17 @@ LBL_UriTemplate=Pat&h\: LBL_Folder=&Folder\: -LBL_Browse=B&rowse... +LBL_BrowseFolder=Brow&se... +LBL_BrowseWadl=Bro&wse... +HINT_BrowseFolder=Browse folder to store the stubs. +HINT_BrowseWadl=Browse the target WADL file. LBL_AddProject=&Add Project... LBL_RemoveProject=&Remove LBL_ProjectsToGenerateStubFor=Projects to &Generate Stubs for\: LBL_WADLToGenerateStubFor=Specify a &WADL file to Generate Stubs for\: +HINT_WADLToGenerateStubFor=Target WADL file location. LBL_OverwriteExisting=&Overwrite Existing Stubs Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsIterator.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/ClientStubsIterator.java,v retrieving revision 1.5 diff -u -r1.5 ClientStubsIterator.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsIterator.java 15 Jan 2008 08:41:29 -0000 1.5 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsIterator.java 28 Mar 2008 17:00:37 -0000 @@ -41,13 +41,10 @@ package org.netbeans.modules.websvc.rest.wizard; import java.awt.Component; -import java.io.File; import java.io.IOException; import java.util.HashSet; import java.util.NoSuchElementException; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JComponent; import javax.swing.event.ChangeListener; import org.netbeans.api.progress.ProgressHandle; @@ -55,6 +52,7 @@ import org.netbeans.modules.websvc.rest.codegen.ClientStubsGenerator; import org.openide.WizardDescriptor; import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; @@ -137,7 +135,7 @@ result.addAll(new ClientStubsGenerator(stubRoot, stubFolder, wadlFile, createJmaki, overwrite).generate(pHandle)); } } catch(Exception iox) { - Logger.getLogger(getClass().getName()).log(Level.INFO, "instantiate", iox); + Exceptions.printStackTrace(iox); } finally { dialog.close(); pHandle.finish(); @@ -147,7 +145,7 @@ generatorTask.schedule(50); dialog.open(); } catch (Exception ex) { - Logger.getLogger(getClass().getName()).log(Level.INFO, "instantiate", ex); + Exceptions.printStackTrace(ex); } return result; } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanel.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/ClientStubsSetupPanel.java,v retrieving revision 1.2 diff -u -r1.2 ClientStubsSetupPanel.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanel.java 5 Oct 2007 17:50:50 -0000 1.2 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanel.java 28 Mar 2008 17:00:37 -0000 @@ -72,10 +72,7 @@ } public HelpCtx getHelp() { - // Show no Help button for this panel: - return HelpCtx.DEFAULT_HELP; - // If you have context help: - // return new HelpCtx(SampleWizardPanel1.class); + return new HelpCtx(ClientStubsSetupPanel.class); } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanelVisual.form =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/ClientStubsSetupPanelVisual.form,v retrieving revision 1.7.2.1 diff -u -r1.7.2.1 ClientStubsSetupPanelVisual.form --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanelVisual.form 22 Jan 2008 18:45:24 -0000 1.7.2.1 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanelVisual.form 28 Mar 2008 17:00:37 -0000 @@ -5,11 +5,19 @@ + + + + + + + + - + - + @@ -19,67 +27,62 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + + + - + - - - - - - - + + + + + + + + + - - - - + + + + + + + + + - - @@ -89,43 +92,44 @@ - + - + - + - + - - - - - - - - - - - + + + + + - + - + + - - + + + + + + + + - + @@ -133,6 +137,9 @@ + + + @@ -161,6 +168,9 @@ + + + @@ -186,6 +196,9 @@ + + + @@ -212,7 +225,10 @@ - + + + + @@ -320,10 +336,10 @@ - + @@ -334,6 +350,9 @@ + + + @@ -344,6 +363,9 @@ + + + @@ -352,7 +374,10 @@ - + + + + @@ -360,6 +385,14 @@ + + + + + + + + Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanelVisual.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/ClientStubsSetupPanelVisual.java,v retrieving revision 1.9.2.1 diff -u -r1.9.2.1 ClientStubsSetupPanelVisual.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanelVisual.java 22 Jan 2008 18:45:24 -0000 1.9.2.1 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ClientStubsSetupPanelVisual.java 28 Mar 2008 17:00:37 -0000 @@ -44,12 +44,8 @@ import java.awt.Dimension; import java.io.File; import java.io.IOException; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JFileChooser; @@ -77,6 +73,7 @@ import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.loaders.DataFolder; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; /** @@ -121,6 +118,13 @@ sourceGroups = Util.getSourceGroups(project); SourceGroupUISupport.connect(locationCB, sourceGroups); folderTextField.setText(Constants.REST_JMAKI_DIR); + + if (isJmakiEnabled(project)) { + if (!createJmakiCheckBox.isEnabled()) { + createJmakiCheckBox.setEnabled(true); + createJmakiCheckBox.setSelected(true); + } + } } } @@ -239,10 +243,12 @@ continue; } ProjectInformation pInfo = ProjectUtils.getInformation(p); + if(!listModel.contains(pInfo)) { listModel.addElement(pInfo); changed = true; + } } catch(IOException ioe) { - Logger.getLogger(getClass().getName()).log(Level.INFO, ioe.getLocalizedMessage(), ioe); + Exceptions.printStackTrace(ioe); } } if (rejecteds.size() > 0) { @@ -282,15 +288,19 @@ wadlTextField = new javax.swing.JTextField(); jSeparator2 = new javax.swing.JSeparator(); + projectLabel.setLabelFor(projectTextField); org.openide.awt.Mnemonics.setLocalizedText(projectLabel, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_Project")); // NOI18N projectTextField.setEditable(false); + locationLabel.setLabelFor(locationCB); org.openide.awt.Mnemonics.setLocalizedText(locationLabel, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_Location")); // NOI18N + folderLabel.setLabelFor(folderTextField); org.openide.awt.Mnemonics.setLocalizedText(folderLabel, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_Folder")); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_Browse")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_BrowseFolder")); // NOI18N + browseButton.setToolTipText(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("HINT_BrowseFolder")); // NOI18N browseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { browseButtonActionPerformed(evt); @@ -333,8 +343,8 @@ overwriteCheckBox.setSelected(true); org.openide.awt.Mnemonics.setLocalizedText(overwriteCheckBox, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_OverwriteExisting")); // NOI18N - createJmakiCheckBox.setSelected(true); org.openide.awt.Mnemonics.setLocalizedText(createJmakiCheckBox, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_CreateJmakiRestComponents")); // NOI18N + createJmakiCheckBox.setEnabled(false); createJmakiCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { createJmakiCheckBoxStateChanged(evt); @@ -342,6 +352,7 @@ }); org.openide.awt.Mnemonics.setLocalizedText(projectRadioButton, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_ProjectsToGenerateStubFor")); // NOI18N + projectRadioButton.setToolTipText(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("DESC_ProjectList")); // NOI18N projectRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { projectRadioButtonActionPerformed(evt); @@ -349,13 +360,15 @@ }); org.openide.awt.Mnemonics.setLocalizedText(wadlRadioButton, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_WADLToGenerateStubFor")); // NOI18N + wadlRadioButton.setToolTipText(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("HINT_WADLToGenerateStubFor")); // NOI18N wadlRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { wadlRadioButtonActionPerformed(evt); } }); - org.openide.awt.Mnemonics.setLocalizedText(wadlBrowseButton, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_Browse")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(wadlBrowseButton, org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "LBL_BrowseWadl")); // NOI18N + wadlBrowseButton.setToolTipText(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("HINT_BrowseWadl")); // NOI18N wadlBrowseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { wadlBrowseButtonActionPerformed(evt); @@ -379,50 +392,51 @@ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(projectRadioButton) - .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 738, Short.MAX_VALUE) - .add(layout.createSequentialGroup() + .add(createJmakiCheckBox) + .add(18, 18, 18) + .add(overwriteCheckBox) + .addContainerGap(127, Short.MAX_VALUE)) + .add(jSeparator2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 467, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(org.jdesktop.layout.GroupLayout.LEADING, projectLabel) + .add(org.jdesktop.layout.GroupLayout.LEADING, projectRadioButton) + .add(org.jdesktop.layout.GroupLayout.LEADING, wadlRadioButton) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(locationLabel) - .add(folderLabel)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(locationCB, 0, 530, Short.MAX_VALUE) - .add(projectTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, folderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) - .add(projectLabel)) - .add(7, 7, 7)) + .add(folderLabel) + .add(14, 14, 14) + .add(folderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE) + .add(6, 6, 6)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() - .add(createJmakiCheckBox) - .add(18, 18, 18) - .add(overwriteCheckBox)) + .add(21, 21, 21) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(org.jdesktop.layout.GroupLayout.LEADING, wadlTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)) + .add(4, 4, 4)) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() - .add(72, 72, 72) - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 522, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(wadlTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 535, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(wadlBrowseButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 124, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) - .add(removeButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(addButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(browseButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 122, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) - .add(jSeparator2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 738, Short.MAX_VALUE) + .add(48, 48, 48) + .add(projectTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)) .add(layout.createSequentialGroup() - .add(wadlRadioButton) - .addContainerGap(487, Short.MAX_VALUE)))) + .add(locationLabel) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(locationCB, 0, 312, Short.MAX_VALUE))) + .add(6, 6, 6))) + .add(0, 0, 0) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(browseButton) + .add(addButton) + .add(removeButton) + .add(wadlBrowseButton))) + .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 467, Short.MAX_VALUE) ); + + layout.linkSize(new java.awt.Component[] {addButton, browseButton, removeButton, wadlBrowseButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); + layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(projectLabel) .add(projectTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) @@ -434,32 +448,33 @@ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(folderLabel) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(folderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(browseButton))) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(browseButton) + .add(folderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(8, 8, 8) .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(2, 2, 2) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(projectRadioButton) - .add(29, 29, 29) - .add(addButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(removeButton)) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() - .add(142, 142, 142) - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 105, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(wadlRadioButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(wadlTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(wadlBrowseButton)) - .add(5, 5, 5) - .add(jSeparator2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(wadlBrowseButton) + .add(wadlTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(layout.createSequentialGroup() + .add(addButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(removeButton))) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jSeparator2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(createJmakiCheckBox) .add(overwriteCheckBox)) - .addContainerGap(41, Short.MAX_VALUE)) + .addContainerGap()) ); projectLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "Project")); // NOI18N @@ -482,6 +497,11 @@ removeButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "DESC_RemoveProject")); // NOI18N overwriteCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "OverwriteExistingStubs")); // NOI18N overwriteCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClientStubsSetupPanelVisual.class, "DESC_OverwriteExisting")); // NOI18N + wadlTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("HINT_WADLToGenerateStubFor")); // NOI18N + wadlTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("HINT_WADLToGenerateStubFor")); // NOI18N + + getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("Templates/WebServices/RestClientStubs")); // NOI18N + getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(ClientStubsSetupPanelVisual.class).getString("Templates/WebServices/RestClientStubs")); // NOI18N }// //GEN-END:initComponents private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed @@ -594,10 +614,7 @@ }//GEN-LAST:event_wadlTextFieldKeyTyped private boolean validateWadlFile(final String fileName) { - String name = fileName.replaceAll(File.separator, "/"); - if(!name.startsWith("/")) - name = "/"+name; - File f = new File(name); + File f = new File(fileName); boolean isValid = false; try { if(f.isFile()) { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ContainerItemSetupPanelVisual.form =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/ContainerItemSetupPanelVisual.form,v retrieving revision 1.6 diff -u -r1.6 ContainerItemSetupPanelVisual.form --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ContainerItemSetupPanelVisual.form 18 Jan 2008 07:03:05 -0000 1.6 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ContainerItemSetupPanelVisual.form 28 Mar 2008 17:00:38 -0000 @@ -16,6 +16,7 @@ + @@ -29,11 +30,11 @@ - + - + @@ -47,14 +48,14 @@ - - - - - + + + + + - + @@ -66,11 +67,11 @@ - - - - - + + + + + Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ContainerItemSetupPanelVisual.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/ContainerItemSetupPanelVisual.java,v retrieving revision 1.12 diff -u -r1.12 ContainerItemSetupPanelVisual.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ContainerItemSetupPanelVisual.java 18 Jan 2008 07:03:05 -0000 1.12 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/ContainerItemSetupPanelVisual.java 28 Mar 2008 17:00:39 -0000 @@ -68,9 +68,9 @@ import org.netbeans.modules.websvc.rest.wizard.PatternResourcesSetupPanel.Pattern; import org.netbeans.spi.java.project.support.ui.PackageView; import org.netbeans.spi.project.ui.templates.support.Templates; -import org.openide.ErrorManager; import org.openide.WizardDescriptor; import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; import org.openide.util.Utilities; /** @@ -408,7 +408,7 @@ private void selectClassButtonMouseClickHandler(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_selectClassButtonMouseClickHandler SwingUtilities.invokeLater(new Runnable() { public void run() { - final ElementHandle handle = TypeElementFinder.find(null, new TypeElementFinder.Customizer() { + final ElementHandle handle = TypeElementFinder.find(Util.getClasspathInfo(project), new TypeElementFinder.Customizer() { public Set> query(ClasspathInfo classpathInfo, String textForQuery, NameKind nameKind, Set searchScopes) { return classpathInfo.getClassIndex().getDeclaredTypes(textForQuery, nameKind, searchScopes); @@ -489,7 +489,7 @@ SwingUtilities.invokeLater(new Runnable() { public void run() { - final ElementHandle handle = TypeElementFinder.find(null, new TypeElementFinder.Customizer() { + final ElementHandle handle = TypeElementFinder.find(Util.getClasspathInfo(project), new TypeElementFinder.Customizer() { public Set> query(ClasspathInfo classpathInfo, String textForQuery, NameKind nameKind, Set searchScopes) { return classpathInfo.getClassIndex().getDeclaredTypes(textForQuery, nameKind, searchScopes); @@ -733,7 +733,7 @@ try { Templates.setTargetFolder(settings, SourceGroupSupport.getFolderForPackage(getLocationValue(), getPackage(), true)); } catch (IOException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntityResourcesIterator.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/EntityResourcesIterator.java,v retrieving revision 1.5 diff -u -r1.5 EntityResourcesIterator.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntityResourcesIterator.java 16 Jan 2008 05:40:11 -0000 1.5 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntityResourcesIterator.java 28 Mar 2008 17:00:39 -0000 @@ -47,19 +47,17 @@ import java.util.Set; import javax.swing.event.ChangeListener; import org.netbeans.api.project.Project; -import org.netbeans.api.project.SourceGroup; import org.netbeans.modules.websvc.rest.RestUtils; import org.netbeans.modules.websvc.rest.codegen.EntityResourcesGenerator; import org.netbeans.modules.websvc.rest.codegen.model.EntityResourceBeanModel; import org.netbeans.modules.websvc.rest.support.PersistenceHelper; import org.netbeans.modules.websvc.rest.support.SourceGroupSupport; -import org.netbeans.spi.java.project.support.ui.templates.JavaTemplates; import org.netbeans.spi.project.ui.templates.support.Templates; -import org.openide.ErrorManager; import org.openide.WizardDescriptor; import org.openide.filesystems.FileObject; import org.openide.loaders.DataFolder; import org.openide.loaders.TemplateWizard; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; @@ -101,7 +99,7 @@ generator.generate(progressDialog.getProgressHandle()); } catch(Exception iox) { - ErrorManager.getDefault().notify(iox); + Exceptions.printStackTrace(iox); } finally { RestUtils.enableRestServicesChangeListner(project); progressDialog.close(); Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanel.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/EntitySelectionPanel.java,v retrieving revision 1.9 diff -u -r1.9 EntitySelectionPanel.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanel.java 5 Oct 2007 17:50:43 -0000 1.9 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanel.java 28 Mar 2008 17:00:39 -0000 @@ -42,10 +42,8 @@ package org.netbeans.modules.websvc.rest.wizard; import java.awt.Component; -import java.util.List; import org.netbeans.api.project.Project; import org.netbeans.modules.websvc.rest.spi.RestSupport; -import org.netbeans.modules.websvc.rest.support.JavaSourceHelper; import org.netbeans.modules.websvc.rest.support.PersistenceHelper; import org.netbeans.spi.project.ui.templates.support.Templates; import org.openide.WizardDescriptor; @@ -63,7 +61,7 @@ } public HelpCtx getHelp() { - return HelpCtx.DEFAULT_HELP; + return new HelpCtx(EntitySelectionPanel.class); } public boolean isFinishPanel() { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanelVisual.form =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/EntitySelectionPanelVisual.form,v retrieving revision 1.12 diff -u -r1.12 EntitySelectionPanelVisual.form --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanelVisual.form 3 Nov 2007 23:39:24 -0000 1.12 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanelVisual.form 28 Mar 2008 17:00:39 -0000 @@ -2,6 +2,7 @@
+ @@ -107,7 +108,6 @@ - @@ -167,7 +167,7 @@ - + Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanelVisual.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/EntitySelectionPanelVisual.java,v retrieving revision 1.23 diff -u -r1.23 EntitySelectionPanelVisual.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanelVisual.java 3 Nov 2007 23:39:25 -0000 1.23 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/EntitySelectionPanelVisual.java 28 Mar 2008 17:00:39 -0000 @@ -44,8 +44,10 @@ import java.awt.Component; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.logging.Level; @@ -54,7 +56,6 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.ListCellRenderer; -import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.ListSelectionEvent; @@ -69,10 +70,12 @@ import org.netbeans.modules.websvc.rest.codegen.model.EntityClassInfo; import org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder; import org.netbeans.modules.websvc.rest.codegen.model.EntityResourceBeanModel; +import org.netbeans.modules.websvc.rest.codegen.model.RuntimeJpaEntity; import org.netbeans.modules.websvc.rest.support.MetadataModelReadHelper; import org.netbeans.spi.project.ui.templates.support.Templates; import org.openide.WizardDescriptor; import org.openide.util.NbBundle; +import org.openide.util.RequestProcessor; /** @@ -142,11 +145,6 @@ listAvailable.getAccessibleContext().setAccessibleDescription(bundle.getString("DESC_AvailableEntityClasses")); // NOI18N listSelected.setCellRenderer(ENTITY_LIST_RENDERER); - listSelected.addPropertyChangeListener(new java.beans.PropertyChangeListener() { - public void propertyChange(java.beans.PropertyChangeEvent evt) { - listSelectedPropertyChange(evt); - } - }); listSelected.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { listSelectedValueChanged(evt); @@ -216,7 +214,7 @@ .add(buttonAddAll) .add(18, 18, 18) .add(buttonRemoveAll) - .addContainerGap(131, Short.MAX_VALUE)) + .addContainerGap(139, Short.MAX_VALUE)) ); buttonAdd.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(EntitySelectionPanelVisual.class, "AddEntityClass")); // NOI18N @@ -308,10 +306,6 @@ fireChange(); }//GEN-LAST:event_addActionPerformed -private void listSelectedPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_listSelectedPropertyChange - fireChange(); -}//GEN-LAST:event_listSelectedPropertyChange - private void listSelectedValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listSelectedValueChanged fireChange(); }//GEN-LAST:event_listSelectedValueChanged @@ -389,7 +383,10 @@ EntityListModel availableModel = new EntityListModel(true); listAvailable.setModel(availableModel); - this.addChangeListener(availableModel); + addChangeListener(availableModel); + + availableModel.addElement(MSG_RETRIEVING); + listAvailable.ensureIndexIsVisible(0); entitiesHelper.addChangeListener(availableModel); entitiesHelper.start(); @@ -452,9 +449,6 @@ EntityListModel(boolean available) { this.available = available; - if (available) { - addElement(MSG_RETRIEVING); - } } public void stateChanged(ChangeEvent e) { @@ -470,17 +464,29 @@ throw new IllegalStateException(ex); } - SwingUtilities.invokeLater(new Runnable() { + RequestProcessor.getDefault().post(new Runnable() { public void run() { + Map entities = new HashMap(); + for (Entity e : RuntimeJpaEntity.getEntityFromClasspath(project)) { + if (entities.get(e.getClass2()) == null) { + entities.put(e.getClass2(), e); + } + } + removeElement(MSG_RETRIEVING); - List entities = getAllEntities(); - builder = new EntityResourceModelBuilder(project, entities); - for (Entity entity : entities) { - addElement(entity); + for (Entity e : mappings.getEntity()) { + if (entities.get(e.getClass2()) == null) { + entities.put(e.getClass2(), e); + } + } + + for (Map.Entry entry : entities.entrySet()) { + addElement(entry.getValue()); } updateButtons(); + builder = new EntityResourceModelBuilder(project, entities.values()); } }); } @@ -531,7 +537,7 @@ return false; } - if (entitiesHelper.isReady() && mappings != null && mappings.getEntity().length == 0) { + if (entitiesHelper.isReady() && (listAvailable.getModel().getSize()+listSelected.getModel().getSize()) == 0) { AbstractPanel.setErrorMessage(wizard, "MSG_EntitySelectionPanel_NoEntities"); return false; } @@ -551,9 +557,6 @@ return true; } - public List getAllEntities() { - return new ArrayList(Arrays.asList(mappings.getEntity())); - } private EntityResourceBeanModel getResourceModel() { if (resourceModel == null) { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternResourcesIterator.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/PatternResourcesIterator.java,v retrieving revision 1.5 diff -u -r1.5 PatternResourcesIterator.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternResourcesIterator.java 16 Jan 2008 05:40:12 -0000 1.5 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternResourcesIterator.java 28 Mar 2008 17:00:39 -0000 @@ -55,10 +55,9 @@ import org.netbeans.modules.websvc.rest.codegen.model.GenericResourceBean; import org.netbeans.modules.websvc.rest.wizard.PatternResourcesSetupPanel.Pattern; import org.netbeans.spi.project.ui.templates.support.Templates; -import org.openide.ErrorManager; import org.openide.WizardDescriptor; import org.openide.filesystems.FileObject; -import org.openide.loaders.TemplateWizard; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; @@ -92,7 +91,7 @@ result.addAll(new GenericResourceGenerator(targetFolder, bean).generate(pHandle)); } } catch(Exception iox) { - ErrorManager.getDefault().notify(iox); + Exceptions.printStackTrace(iox); } finally { pHandle.finish(); dialog.close(); @@ -102,7 +101,7 @@ generatorTask.schedule(50); dialog.open(); } catch (Exception ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } return result; } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanel.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/PatternSelectionPanel.java,v retrieving revision 1.3 diff -u -r1.3 PatternSelectionPanel.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanel.java 5 Oct 2007 17:50:39 -0000 1.3 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanel.java 28 Mar 2008 17:00:39 -0000 @@ -72,7 +72,7 @@ } public HelpCtx getHelp() { - return HelpCtx.DEFAULT_HELP; + return new HelpCtx(PatternSelectionPanel.class); } public boolean isValid() { Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanelVisual.form =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/PatternSelectionPanelVisual.form,v retrieving revision 1.3 diff -u -r1.3 PatternSelectionPanelVisual.form --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanelVisual.form 16 Oct 2007 07:21:08 -0000 1.3 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanelVisual.form 28 Mar 2008 17:00:39 -0000 @@ -20,6 +20,7 @@ + @@ -31,10 +32,10 @@ - + Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanelVisual.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/PatternSelectionPanelVisual.java,v retrieving revision 1.5 diff -u -r1.5 PatternSelectionPanelVisual.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanelVisual.java 17 Oct 2007 20:52:29 -0000 1.5 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/PatternSelectionPanelVisual.java 28 Mar 2008 17:00:40 -0000 @@ -86,6 +86,8 @@ jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); + setName("null"); + jPanel2.setBackground(new java.awt.Color(255, 255, 255)); jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); @@ -164,10 +166,10 @@ this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 300, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel2) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/SingletonSetupPanelVisual.form =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/SingletonSetupPanelVisual.form,v retrieving revision 1.8 diff -u -r1.8 SingletonSetupPanelVisual.form --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/SingletonSetupPanelVisual.form 18 Jan 2008 07:03:05 -0000 1.8 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/SingletonSetupPanelVisual.form 28 Mar 2008 17:00:40 -0000 @@ -37,9 +37,9 @@ - - - + + + @@ -53,15 +53,15 @@ - - - + + + - + - + Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/SingletonSetupPanelVisual.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/SingletonSetupPanelVisual.java,v retrieving revision 1.12 diff -u -r1.12 SingletonSetupPanelVisual.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/SingletonSetupPanelVisual.java 18 Jan 2008 07:03:05 -0000 1.12 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/SingletonSetupPanelVisual.java 28 Mar 2008 17:00:40 -0000 @@ -68,9 +68,9 @@ import org.netbeans.modules.websvc.rest.support.SourceGroupSupport; import org.netbeans.spi.java.project.support.ui.PackageView; import org.netbeans.spi.project.ui.templates.support.Templates; -import org.openide.ErrorManager; import org.openide.WizardDescriptor; import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; /** * @@ -356,7 +356,7 @@ private void mouseClickHandler(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mouseClickHandler SwingUtilities.invokeLater(new Runnable() { public void run() { - final ElementHandle handle = TypeElementFinder.find(null, new TypeElementFinder.Customizer() { + final ElementHandle handle = TypeElementFinder.find(Util.getClasspathInfo(project), new TypeElementFinder.Customizer() { public Set> query(ClasspathInfo classpathInfo, String textForQuery, NameKind nameKind, Set searchScopes) { return classpathInfo.getClassIndex().getDeclaredTypes(textForQuery, nameKind, searchScopes); @@ -542,7 +542,7 @@ try { Templates.setTargetFolder(settings, SourceGroupSupport.getFolderForPackage(getLocationValue(), getPackage(), true)); } catch (IOException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + Exceptions.printStackTrace(ex); } } Index: websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Util.java =================================================================== RCS file: /cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Attic/Util.java,v retrieving revision 1.30 diff -u -r1.30 Util.java --- websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Util.java 18 Jan 2008 07:03:06 -0000 1.30 +++ websvc/rest/src/org/netbeans/modules/websvc/rest/wizard/Util.java 28 Mar 2008 17:00:41 -0000 @@ -54,6 +54,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.netbeans.api.java.classpath.ClassPath; +import org.netbeans.api.java.source.ClasspathInfo; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectUtils; import org.netbeans.api.project.SourceGroup; @@ -404,5 +405,13 @@ } } return true; + } + + public static ClasspathInfo getClasspathInfo(Project p) { + FileObject fileObject = p.getProjectDirectory(); + return ClasspathInfo.create( + ClassPath.getClassPath(fileObject, ClassPath.BOOT), // JDK classes + ClassPath.getClassPath(fileObject, ClassPath.COMPILE), // classpath from dependent projects and libraries + ClassPath.getClassPath(fileObject, ClassPath.SOURCE)); // source classpath } } Index: websvc/restapi/manifest.mf =================================================================== RCS file: /cvs/websvc/restapi/Attic/manifest.mf,v retrieving revision 1.6.2.2 diff -u -r1.6.2.2 manifest.mf --- websvc/restapi/manifest.mf 11 Mar 2008 22:05:44 -0000 1.6.2.2 +++ websvc/restapi/manifest.mf 28 Mar 2008 17:00:41 -0000 @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.restapi/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/rest/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.6 +OpenIDE-Module-Specification-Version: 0.6.0.2 AutoUpdate-Show-In-Client: false Index: websvc/restapi/src/org/netbeans/modules/websvc/rest/model/api/HttpMethod.java =================================================================== RCS file: /cvs/websvc/restapi/src/org/netbeans/modules/websvc/rest/model/api/Attic/HttpMethod.java,v retrieving revision 1.3 diff -u -r1.3 HttpMethod.java --- websvc/restapi/src/org/netbeans/modules/websvc/rest/model/api/HttpMethod.java 30 Oct 2007 20:37:51 -0000 1.3 +++ websvc/restapi/src/org/netbeans/modules/websvc/rest/model/api/HttpMethod.java 28 Mar 2008 17:00:41 -0000 @@ -33,8 +33,6 @@ */ public interface HttpMethod extends RestMethodDescription { - public enum Type { GET, PUT, POST, DELETE }; - public String getType(); public String getConsumeMime(); Index: websvc/restapi/src/org/netbeans/modules/websvc/rest/model/impl/Utils.java =================================================================== RCS file: /cvs/websvc/restapi/src/org/netbeans/modules/websvc/rest/model/impl/Attic/Utils.java,v retrieving revision 1.7 diff -u -r1.7 Utils.java --- websvc/restapi/src/org/netbeans/modules/websvc/rest/model/impl/Utils.java 14 Jan 2008 19:29:12 -0000 1.7 +++ websvc/restapi/src/org/netbeans/modules/websvc/rest/model/impl/Utils.java 28 Mar 2008 17:00:41 -0000 @@ -42,29 +42,18 @@ package org.netbeans.modules.websvc.rest.model.impl; import java.io.IOException; -import java.net.URL; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; import org.netbeans.modules.websvc.rest.model.api.RestConstants; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; -import javax.lang.model.type.ErrorType; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import javax.tools.Diagnostic; import javax.tools.Diagnostic.Kind; -import org.netbeans.api.java.project.JavaProjectConstants; -import org.netbeans.api.java.queries.UnitTestForSourceQuery; import org.netbeans.api.java.source.CancellableTask; import org.netbeans.api.java.source.ClasspathInfo; import org.netbeans.api.java.source.CompilationController; @@ -73,12 +62,8 @@ import org.netbeans.api.java.source.JavaSource.Phase; import org.netbeans.api.java.source.SourceUtils; import org.netbeans.api.project.Project; -import org.netbeans.api.project.ProjectUtils; -import org.netbeans.api.project.SourceGroup; import org.netbeans.modules.websvc.rest.spi.RestSupport; import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileUtil; -import org.openide.filesystems.URLMapper; import org.openide.util.Exceptions; /** @@ -173,7 +158,7 @@ restSupport.ensureRestDevelopmentReady(); return true; } catch (IOException ex) { - Logger.getLogger(Utils.class.getName()).log(Level.INFO, ex.getLocalizedMessage(), ex); + Exceptions.printStackTrace(ex); } } return false; @@ -212,6 +197,9 @@ public static List getDiagnostics(FileObject fileObject) { final List result = new ArrayList(); + if (fileObject == null) { + return result; + } JavaSource js = JavaSource.forFileObject(fileObject); try { js.runUserActionTask(new CancellableTask() { Index: websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java =================================================================== RCS file: /cvs/websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/Attic/RestSupport.java,v retrieving revision 1.38 diff -u -r1.38 RestSupport.java --- websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java 20 Jan 2008 13:06:46 -0000 1.38 +++ websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java 28 Mar 2008 17:00:41 -0000 @@ -278,7 +278,7 @@ initBuildScripts(); if (! testdir.isDirectory()) { - testdir.mkdirs(); + FileUtil.createFolder(testdir); } String[] replaceKeys1 = { "TTL_TEST_RESBEANS", "MSG_TEST_RESBEANS_Trail", Index: websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/resources/test-resbeans.js =================================================================== RCS file: /cvs/websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/resources/Attic/test-resbeans.js,v retrieving revision 1.49 diff -u -r1.49 test-resbeans.js --- websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/resources/test-resbeans.js 20 Jan 2008 13:06:45 -0000 1.49 +++ websvc/restapi/src/org/netbeans/modules/websvc/rest/spi/resources/test-resbeans.js 28 Mar 2008 17:00:42 -0000 @@ -118,7 +118,6 @@ var mimeNode = document.getElementById("mimeSel"); if(mimeNode == null || mimeNode == undefined) { this.currentMimeType = this.wdr.getMimeType(method); - //ts.debug(currentMimeType); } this.currentMethod = this.wdr.getMethod(method); document.getElementById("methodName").value = this.currentMethod; @@ -130,7 +129,7 @@ } var paramRep = this.getParamRep(request, this.currentMethod); this.updatepage('paramHook', paramRep); - this.updatepage('mimeType', this.currentMimeType); + document.getElementById("mimeType").value = this.currentMimeType; ts.clearOutput(); }, @@ -138,7 +137,7 @@ { var mimeNode = document.getElementById("mimeSel"); var mime = mimeNode.options[mimeNode.selectedIndex].value; - ts.updatepage('mimeType', mime); + document.getElementById("mimeType").value = mime; }, getMethodMimeTypeCombo : function (resource) { @@ -157,9 +156,9 @@ var mimeType = mimeTypes[k]; var dispName = this.wdr.getMethodNameForDisplay(mName, mimeType); if(mName == 'GET') - str += " "; + str += " "; else - str += " "; + str += " "; } } str += "Test"; @@ -220,19 +219,19 @@ var str = '
'; str += ""; str += ''; str += ""; str += "'; - paramRep += ''; + paramRep += ''; } } if(paramRep != "") { paramRep = ''+ '' + paramRep; - ts.updatepage('paramHook', "
" str += "Add Parameter"; @@ -246,16 +245,16 @@ var path = paths[i]; if(path.indexOf('{') > -1) { var pname = path.substring(1, path.length-1); - paramRep += '
"+paramRep+"
"); + ts.updatepage('pathParamHook', ""+paramRep+"
"); } var req = uri; var disp = this.getDisplayUri(req); @@ -293,6 +292,7 @@ //ts.debug(req + uri + mName + mediaType); var str = "
"; str += ""; + str += "
"; str += "
"; str += ""; str += ""; @@ -403,7 +403,7 @@ var pname = paths[i]; if(pname == '') continue; - currPath += '/'+pname; + currPath += '/'+pname+'/'; var ndx = 0; var jsmethod = "ts.doShowContent('"+currPath+"')"; for(var j=0;j'+ ''; @@ -728,9 +727,7 @@ '
'+tableContent+'
'+ '
'+subResources+'
'+ '
'+this.printPretty(rawContent)+'
'+ - //'
'+ '
'+this.currMonitorText+'
'+ - //'')+ ''); if(showRaw) { if(content.length > 7 && content.substring(0, 7) == "http://") @@ -738,8 +735,14 @@ if(this.currentMethod == 'GET' && this.currentMimeType == 'text/html') { this.updatepage('rawContent', ''); this.createIFrameForContent(content); + } else if(content.indexOf("WADL: '+ts.wadlURL); + ts.updatepage('subheader', '
WADL: '+ts.wadlURL+''); ts.wadlDoc = ts.xhr.loadXml(rtext); if(ts.wadlDoc != null) { this.initTree(ts.wadlDoc); @@ -1201,8 +1205,18 @@ function createNode(/*Node*/ n, parentCat) { var pathVal = ts.wdr.getNormailizedPath(n); + var pathElem = ''; + if(pathVal.substring(0,1) == '/') + pathElem = pathVal.substring(1); + else + pathElem = pathVal; + var parentUri = parentCat.uri; + var uri =''; + if(parentUri.substring(parentUri.length-1) == '/') + uri = parentCat.uri+pathElem; + else + uri = parentCat.uri+'/'+pathElem; var cName = ts.wdr.trimSeperator(pathVal); - var uri = parentCat.uri+'/'+cName; if(ts.wdr.hasResource(n)) { return new category(n, pathVal, uri, cName); } else { @@ -1211,9 +1225,6 @@ return new item(n, pathVal, uri, cName); } else { var n2 = ts.wdr.findResource(baseURL+pathVal); - //if(n2 == null) - // n2 = n; - //return new item(n2, pathVal, cName); if(n2 == null) { return new item(n, pathVal, uri, cName); } else { @@ -1283,33 +1294,77 @@ }, evaluateWADLUpdate : function (uri, content) { - - function nsResolver(prefix) { - var ns = { - 'xmlns' : 'http://research.sun.com/wadl/2006/10' - }; - return ns[prefix] || null; - } - - var xmlDoc = ts.xhr.loadXml(content); - var iterator = xmlDoc.evaluate('//xmlns:resource', xmlDoc, nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); - var str = ''; try { - var thisNode = iterator.iterateNext(); - thisNode = iterator.iterateNext(); - while (thisNode) { - str += ''; + var resources = this.getAllResourcesFromWadl(content); + if(resources != null) { + for (i=0;i'; thisNode = iterator.iterateNext(); } - str += ''; + } } catch (e) { dump( 'Error: Document tree modified during iteration ' + e ); } + str += ''; return str; }, + /* + + + + + */ + getAllResourcesFromWadl : function (content) { + try { + if(content.indexOf(" 0 && + subChild.attributes.getNamedItem('path') != null) { + this.wadlResources.push(subChild); + } + if(subChild.nodeName == 'resource' || + subChild.nodeName == 'resources') { + this.findResourcesFromWadlRecursively(subChild); + } + } + } + }, + showCategory : function (category){ var categoryChildNodes = document.getElementById(category).style; if(categoryChildNodes.display=="block") @@ -1344,20 +1399,24 @@ var mName = m.attributes.getNamedItem("name").nodeValue; var request = m.getElementsByTagName('request'); var response = m.getElementsByTagName('response'); - var mediaType = null; + var mediaType = ''; var io = request; if(mName == 'GET') io = response; if(io != null && io.length > 0) { var rep = io[0].getElementsByTagName('representation'); - if(rep != null && rep.length > 0) { - if(rep[0].attributes.length > 0) { - var att = rep[0].attributes.getNamedItem('mediaType'); + if(rep != null) { + for(var i=0;i 0) { + var att = rep[i].attributes.getNamedItem('mediaType'); if(att != null) - mediaType = att.nodeValue + mediaType += att.nodeValue + ','; } } } + } + if(mediaType.length > 1) + mediaType = mediaType.substring(0, mediaType.length-1); return mediaType; }, @@ -1788,9 +1847,10 @@ isResponseReady : function (xmlHttpReq, param, monitor) { if (xmlHttpReq.readyState == 4) { + if(monitor) { ts.currentXmlHttpReq = xmlHttpReq; - if(monitor) ts.monitor(xmlHttpReq, param); + } return true; } else return false; Index: websvc/restkit/build.xml =================================================================== RCS file: /cvs/websvc/restkit/Attic/build.xml,v retrieving revision 1.6 diff -u -r1.6 build.xml --- websvc/restkit/build.xml 30 Oct 2007 20:25:51 -0000 1.6 +++ websvc/restkit/build.xml 28 Mar 2008 17:00:42 -0000 @@ -61,6 +61,7 @@ + Index: websvc/restkit/manifest.mf =================================================================== RCS file: /cvs/websvc/restkit/Attic/manifest.mf,v retrieving revision 1.5.2.2 diff -u -r1.5.2.2 manifest.mf --- websvc/restkit/manifest.mf 11 Mar 2008 22:04:10 -0000 1.5.2.2 +++ websvc/restkit/manifest.mf 28 Mar 2008 17:00:42 -0000 @@ -1,6 +1,6 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.netbeans.modules.websvc.restkit/0 -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/restkit/Bundle.properties -OpenIDE-Module-Specification-Version: 0.6 - - +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.modules.websvc.restkit/0 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/restkit/Bundle.properties +OpenIDE-Module-Specification-Version: 0.6.0.2 + + Index: websvc/restkit/nbproject/project.properties =================================================================== RCS file: /cvs/websvc/restkit/nbproject/Attic/project.properties,v retrieving revision 1.4 diff -u -r1.4 project.properties --- websvc/restkit/nbproject/project.properties 16 Jan 2008 19:35:43 -0000 1.4 +++ websvc/restkit/nbproject/project.properties 28 Mar 2008 17:00:42 -0000 @@ -48,4 +48,4 @@ ${nb_all}/websvc/restkit/build/libs/httpunit-1.6.2.jar:\ ${nb_all}/websvc/restkit/build/libs/js-1.6R7.jar:\ ${nb_all}/websvc/restkit/build/libs/jtidy-4aug2000r7-dev.jar:\ - ${nb_all}/websvc/kit/test/lib/tests-qa-functional.jar \ No newline at end of file + ${nb_all}/websvc/kit/test/lib/tests-qa-functional.jar Index: websvc/restkit/nbproject/project.xml =================================================================== RCS file: /cvs/websvc/restkit/nbproject/Attic/project.xml,v retrieving revision 1.11.2.4 diff -u -r1.11.2.4 project.xml --- websvc/restkit/nbproject/project.xml 13 Mar 2008 19:36:58 -0000 1.11.2.4 +++ websvc/restkit/nbproject/project.xml 28 Mar 2008 17:00:42 -0000 @@ -48,7 +48,7 @@ org.netbeans.modules.websvc.components.google - 0-1 + 0 0.5.1 @@ -56,28 +56,34 @@ org.netbeans.modules.websvc.components.strikeiron 0 - 0.4 + 0.5 + + + + org.netbeans.modules.websvc.kit + + 1.0 org.netbeans.modules.websvc.rest 0 - 0.6 + 0.6.0.2 org.netbeans.modules.websvc.rest.samples 0 - 0.6 + 0.6.0.2 org.netbeans.modules.websvc.restapi 0 - 0.6 + 0.6.0.2 @@ -86,7 +92,7 @@ 0 - 0.6 + 0.6.0.2 @@ -94,38 +100,10 @@ qa-functional - org.netbeans.modules.j2ee.dd - - - - org.netbeans.modules.projectapi - - - org.netbeans.modules.websvc.kit - - - org.openide.loaders - - - - org.openide.text - - - - org.openide.filesystems - - - - org.openide.nodes - - - - org.openide.util - Index: websvc/restsamples/manifest.mf =================================================================== RCS file: /cvs/websvc/restsamples/Attic/manifest.mf,v retrieving revision 1.4.2.2 diff -u -r1.4.2.2 manifest.mf --- websvc/restsamples/manifest.mf 11 Mar 2008 22:09:26 -0000 1.4.2.2 +++ websvc/restsamples/manifest.mf 28 Mar 2008 17:00:43 -0000 @@ -1,7 +1,7 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.netbeans.modules.websvc.rest.samples/0 -OpenIDE-Module-Layer: org/netbeans/modules/websvc/rest/samples/resources/layer.xml -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/rest/samples/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.6 -AutoUpdate-Show-In-Client: false - +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.modules.websvc.rest.samples/0 +OpenIDE-Module-Layer: org/netbeans/modules/websvc/rest/samples/resources/layer.xml +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/rest/samples/resources/Bundle.properties +OpenIDE-Module-Specification-Version: 0.6.0.2 +AutoUpdate-Show-In-Client: false + Index: websvc/restsamples/CustomerDB/nbproject/project.properties =================================================================== RCS file: /cvs/websvc/restsamples/CustomerDB/nbproject/Attic/project.properties,v retrieving revision 1.2 diff -u -r1.2 project.properties --- websvc/restsamples/CustomerDB/nbproject/project.properties 30 Oct 2007 23:59:20 -0000 1.2 +++ websvc/restsamples/CustomerDB/nbproject/project.properties 28 Mar 2008 17:00:43 -0000 @@ -42,8 +42,6 @@ build.classes.dir=${build.web.dir}/WEB-INF/classes build.classes.excludes=**/*.java,**/*.form build.dir=build -build.ear.classes.dir=${build.ear.web.dir}/WEB-INF/classes -build.ear.web.dir=${build.dir}/web build.generated.dir=${build.dir}/generated build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results @@ -52,11 +50,9 @@ client.urlPart= compile.jsps=false conf.dir=${source.root}/conf -debug.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir}:\ - ${build.ear.classes.dir}:\ - ${libs.restlib.classpath} +debug.classpath=${javac.classpath}:${build.classes.dir}:${libs.restlib.classpath} +debug.client=false +debug.server=false debug.test.classpath=\ ${run.test.classpath} display.browser=true @@ -67,7 +63,8 @@ j2ee.platform=1.5 j2ee.server.type=J2EE jar.compress=false -javac.classpath= +javac.classpath=\ + ${libs.restlib.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true @@ -94,11 +91,28 @@ lib.dir=${web.docbase.dir}/WEB-INF/lib # Property libs.restapi.classpath is set here just to make sharing of project simpler. # The library definition has always preference over this property. -libs.restapi.classpath=../../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar +libs.restapi.classpath=../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar # Property libs.restlib.classpath is set here just to make sharing of project simpler. # The library definition has always preference over this property. -libs.restlib.classpath=../../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jersey.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jsp-api-2.0-20040521.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/persistence-api-1.0.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/activation.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr250-api.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/localizer.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxrpc16/mail.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/wadl2java.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxws-api.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxb-api.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-impl.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-xjc.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr173_api.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/rome-0.9.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jdom-1.0.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jettison-1.0-RC1.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/comresrcgen.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/grizzly-1.0.13.jar -no.dependencies=false +libs.restlib.classpath=../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jersey.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jsp-api-2.0-20040521.jar;../../nbbuild/netbeans/extra/modules/ext/rest/persistence-api-1.0.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/activation.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr250-api.jar;../../nbbuild/netbeans/extra/modules/ext/rest/localizer.jar;../../nbbuild/netbeans/java1/modules/ext/jaxrpc16/mail.jar;../../nbbuild/netbeans/extra/modules/ext/rest/wadl2java.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxws-api.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxb-api.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-impl.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-xjc.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr173_api.jar;../../nbbuild/netbeans/extra/modules/ext/rest/rome-0.9.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jdom-1.0.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jettison-1.0-RC1.jar;../../nbbuild/netbeans/extra/modules/ext/rest/comresrcgen.jar;../../nbbuild/netbeans/extra/modules/ext/rest/grizzly-1.0.13.jar +libs.restlib.classpath.libfile.1=/space/test/netbeans/enterprise5/modules/ext/rest/jsr311-api.jar +libs.restlib.classpath.libfile.10=/space/test/netbeans/java2/modules/ext/jaxws21/api/jaxb-api.jar +libs.restlib.classpath.libfile.11=/space/test/netbeans/java2/modules/ext/jaxws21/jaxb-impl.jar +libs.restlib.classpath.libfile.12=/space/test/netbeans/java2/modules/ext/jaxws21/jaxb-xjc.jar +libs.restlib.classpath.libfile.13=/space/test/netbeans/java2/modules/ext/jaxws21/api/jsr173_api.jar +libs.restlib.classpath.libfile.14=/space/test/netbeans/enterprise5/modules/ext/rest/rome-0.9.jar +libs.restlib.classpath.libfile.15=/space/test/netbeans/enterprise5/modules/ext/rest/jdom-1.0.jar +libs.restlib.classpath.libfile.16=/space/test/netbeans/enterprise5/modules/ext/rest/jettison-1.0-RC1.jar +libs.restlib.classpath.libfile.17=/space/test/netbeans/enterprise5/modules/ext/rest/asm-3.1.jar +libs.restlib.classpath.libfile.18=/space/test/netbeans/enterprise5/modules/ext/rest/grizzly-http-webserver-1.7.2.jar +libs.restlib.classpath.libfile.2=/space/test/netbeans/enterprise5/modules/ext/rest/jersey.jar +libs.restlib.classpath.libfile.3=/space/test/netbeans/enterprise5/modules/ext/rest/jsp-api-2.0-20040521.jar +libs.restlib.classpath.libfile.4=/space/test/netbeans/enterprise5/modules/ext/rest/persistence-api-1.0.jar +libs.restlib.classpath.libfile.5=/space/test/netbeans/java2/modules/ext/jaxws21/activation.jar +libs.restlib.classpath.libfile.6=/space/test/netbeans/java2/modules/ext/jaxws21/api/jsr250-api.jar +libs.restlib.classpath.libfile.7=/space/test/netbeans/enterprise5/modules/ext/rest/http.jar +libs.restlib.classpath.libfile.8=/space/test/netbeans/enterprise5/modules/ext/rest/wadl2java.jar +libs.restlib.classpath.libfile.9=/space/test/netbeans/java2/modules/ext/jaxws21/api/jaxws-api.jar platform.active=default_platform resource.dir=setup rest.support.on=true Index: websvc/restsamples/CustomerDB/nbproject/project.xml =================================================================== RCS file: /cvs/websvc/restsamples/CustomerDB/nbproject/Attic/project.xml,v retrieving revision 1.2 diff -u -r1.2 project.xml --- websvc/restsamples/CustomerDB/nbproject/project.xml 30 Oct 2007 23:59:20 -0000 1.2 +++ websvc/restsamples/CustomerDB/nbproject/project.xml 28 Mar 2008 17:00:43 -0000 @@ -1,5 +1,4 @@ - - org.netbeans.modules.web.project CustomerDB 1.6 - + + + ${libs.restlib.classpath} + WEB-INF/lib + + - + - + Index: websvc/restsamples/CustomerDBClient/nbproject/project.properties =================================================================== RCS file: /cvs/websvc/restsamples/CustomerDBClient/nbproject/Attic/project.properties,v retrieving revision 1.2 diff -u -r1.2 project.properties --- websvc/restsamples/CustomerDBClient/nbproject/project.properties 30 Oct 2007 23:59:32 -0000 1.2 +++ websvc/restsamples/CustomerDBClient/nbproject/project.properties 28 Mar 2008 17:00:43 -0000 @@ -42,8 +42,6 @@ build.classes.dir=${build.web.dir}/WEB-INF/classes build.classes.excludes=**/*.java,**/*.form build.dir=build -build.ear.classes.dir=${build.ear.web.dir}/WEB-INF/classes -build.ear.web.dir=${build.dir}/web build.generated.dir=${build.dir}/generated build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results @@ -52,7 +50,9 @@ client.urlPart= compile.jsps=false conf.dir=${source.root}/conf -debug.classpath=${javac.classpath}:${build.classes.dir}:${build.ear.classes.dir} +debug.classpath=${javac.classpath}:${build.classes.dir} +debug.client=false +debug.server=false debug.test.classpath=\ ${run.test.classpath} display.browser=true @@ -92,7 +92,6 @@ # Property libs.restapi.classpath is set here just to make sharing of project simpler. # The library definition has always preference over this property. libs.restapi.classpath=../../../../nb/main/nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar -no.dependencies=false platform.active=default_platform resource.dir=setup run.test.classpath=\ Index: websvc/restsamples/CustomerDBClient/nbproject/project.xml =================================================================== RCS file: /cvs/websvc/restsamples/CustomerDBClient/nbproject/Attic/project.xml,v retrieving revision 1.2 diff -u -r1.2 project.xml --- websvc/restsamples/CustomerDBClient/nbproject/project.xml 30 Oct 2007 23:59:33 -0000 1.2 +++ websvc/restsamples/CustomerDBClient/nbproject/project.xml 28 Mar 2008 17:00:43 -0000 @@ -1,5 +1,4 @@ - - org.netbeans.modules.web.project @@ -48,17 +46,17 @@ CustomerDBClient 1.6 - + ${libs.restapi.classpath} WEB-INF/lib - + - + Index: websvc/restsamples/CustomerDBClient/web/WEB-INF/sun-web.xml =================================================================== RCS file: /cvs/websvc/restsamples/CustomerDBClient/web/WEB-INF/Attic/sun-web.xml,v retrieving revision 1.4 diff -u -r1.4 sun-web.xml --- websvc/restsamples/CustomerDBClient/web/WEB-INF/sun-web.xml 30 Oct 2007 23:59:34 -0000 1.4 +++ websvc/restsamples/CustomerDBClient/web/WEB-INF/sun-web.xml 28 Mar 2008 17:00:43 -0000 @@ -41,90 +41,6 @@ made subject to such option by the copyright holder. --> - - - - - - /CustomerDBClient Index: websvc/restsamples/CustomerDBClient/web/WEB-INF/web.xml =================================================================== RCS file: /cvs/websvc/restsamples/CustomerDBClient/web/WEB-INF/Attic/web.xml,v retrieving revision 1.3 diff -u -r1.3 web.xml --- websvc/restsamples/CustomerDBClient/web/WEB-INF/web.xml 30 Oct 2007 23:59:34 -0000 1.3 +++ websvc/restsamples/CustomerDBClient/web/WEB-INF/web.xml 28 Mar 2008 17:00:43 -0000 @@ -41,90 +41,6 @@ made subject to such option by the copyright holder. --> - - - - - - Index: websvc/restsamples/HelloWorld/nbproject/project.properties =================================================================== RCS file: /cvs/websvc/restsamples/HelloWorld/nbproject/Attic/project.properties,v retrieving revision 1.3 diff -u -r1.3 project.properties --- websvc/restsamples/HelloWorld/nbproject/project.properties 30 Oct 2007 23:59:33 -0000 1.3 +++ websvc/restsamples/HelloWorld/nbproject/project.properties 28 Mar 2008 17:00:43 -0000 @@ -42,8 +42,6 @@ build.classes.dir=${build.web.dir}/WEB-INF/classes build.classes.excludes=**/*.java,**/*.form build.dir=build -build.ear.classes.dir=${build.ear.web.dir}/WEB-INF/classes -build.ear.web.dir=${build.dir}/web build.generated.dir=${build.dir}/generated build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results @@ -52,11 +50,9 @@ client.urlPart=/resources/helloWorld compile.jsps=false conf.dir=${source.root}/conf -debug.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir}:\ - ${build.ear.classes.dir}:\ - ${libs.restlib.classpath} +debug.classpath=${javac.classpath}:${build.classes.dir}:${libs.restlib.classpath} +debug.client=false +debug.server=false debug.test.classpath=\ ${run.test.classpath} display.browser=true @@ -67,7 +63,8 @@ j2ee.platform=1.5 j2ee.server.type=J2EE jar.compress=false -javac.classpath= +javac.classpath=\ + ${libs.restlib.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true @@ -94,11 +91,28 @@ lib.dir=${web.docbase.dir}/WEB-INF/lib # Property libs.restapi.classpath is set here just to make sharing of project simpler. # The library definition has always preference over this property. -libs.restapi.classpath=../../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar +libs.restapi.classpath=../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar # Property libs.restlib.classpath is set here just to make sharing of project simpler. # The library definition has always preference over this property. -libs.restlib.classpath=../../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jersey.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jsp-api-2.0-20040521.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/persistence-api-1.0.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/activation.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr250-api.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/localizer.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxrpc16/mail.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/wadl2java.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxws-api.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxb-api.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-impl.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-xjc.jar;../../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr173_api.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/rome-0.9.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jdom-1.0.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/jettison-1.0-RC1.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/comresrcgen.jar;../../../nbbuild/netbeans/extra/modules/ext/rest/grizzly-1.0.13.jar -no.dependencies=false +libs.restlib.classpath=../../nbbuild/netbeans/extra/modules/ext/rest/jsr311-api.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jersey.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jsp-api-2.0-20040521.jar;../../nbbuild/netbeans/extra/modules/ext/rest/persistence-api-1.0.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/activation.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr250-api.jar;../../nbbuild/netbeans/extra/modules/ext/rest/localizer.jar;../../nbbuild/netbeans/java1/modules/ext/jaxrpc16/mail.jar;../../nbbuild/netbeans/extra/modules/ext/rest/wadl2java.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxws-api.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jaxb-api.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-impl.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/jaxb-xjc.jar;../../nbbuild/netbeans/java1/modules/ext/jaxws21/api/jsr173_api.jar;../../nbbuild/netbeans/extra/modules/ext/rest/rome-0.9.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jdom-1.0.jar;../../nbbuild/netbeans/extra/modules/ext/rest/jettison-1.0-RC1.jar;../../nbbuild/netbeans/extra/modules/ext/rest/comresrcgen.jar;../../nbbuild/netbeans/extra/modules/ext/rest/grizzly-1.0.13.jar +libs.restlib.classpath.libfile.1=/space/test/netbeans/enterprise5/modules/ext/rest/jsr311-api.jar +libs.restlib.classpath.libfile.10=/space/test/netbeans/java2/modules/ext/jaxws21/api/jaxb-api.jar +libs.restlib.classpath.libfile.11=/space/test/netbeans/java2/modules/ext/jaxws21/jaxb-impl.jar +libs.restlib.classpath.libfile.12=/space/test/netbeans/java2/modules/ext/jaxws21/jaxb-xjc.jar +libs.restlib.classpath.libfile.13=/space/test/netbeans/java2/modules/ext/jaxws21/api/jsr173_api.jar +libs.restlib.classpath.libfile.14=/space/test/netbeans/enterprise5/modules/ext/rest/rome-0.9.jar +libs.restlib.classpath.libfile.15=/space/test/netbeans/enterprise5/modules/ext/rest/jdom-1.0.jar +libs.restlib.classpath.libfile.16=/space/test/netbeans/enterprise5/modules/ext/rest/jettison-1.0-RC1.jar +libs.restlib.classpath.libfile.17=/space/test/netbeans/enterprise5/modules/ext/rest/asm-3.1.jar +libs.restlib.classpath.libfile.18=/space/test/netbeans/enterprise5/modules/ext/rest/grizzly-http-webserver-1.7.2.jar +libs.restlib.classpath.libfile.2=/space/test/netbeans/enterprise5/modules/ext/rest/jersey.jar +libs.restlib.classpath.libfile.3=/space/test/netbeans/enterprise5/modules/ext/rest/jsp-api-2.0-20040521.jar +libs.restlib.classpath.libfile.4=/space/test/netbeans/enterprise5/modules/ext/rest/persistence-api-1.0.jar +libs.restlib.classpath.libfile.5=/space/test/netbeans/java2/modules/ext/jaxws21/activation.jar +libs.restlib.classpath.libfile.6=/space/test/netbeans/java2/modules/ext/jaxws21/api/jsr250-api.jar +libs.restlib.classpath.libfile.7=/space/test/netbeans/enterprise5/modules/ext/rest/http.jar +libs.restlib.classpath.libfile.8=/space/test/netbeans/enterprise5/modules/ext/rest/wadl2java.jar +libs.restlib.classpath.libfile.9=/space/test/netbeans/java2/modules/ext/jaxws21/api/jaxws-api.jar platform.active=default_platform resource.dir=setup rest.support.on=true Index: websvc/restsamples/HelloWorld/nbproject/project.xml =================================================================== RCS file: /cvs/websvc/restsamples/HelloWorld/nbproject/Attic/project.xml,v retrieving revision 1.2 diff -u -r1.2 project.xml --- websvc/restsamples/HelloWorld/nbproject/project.xml 30 Oct 2007 23:59:33 -0000 1.2 +++ websvc/restsamples/HelloWorld/nbproject/project.xml 28 Mar 2008 17:00:43 -0000 @@ -1,5 +1,4 @@ - - org.netbeans.modules.web.project HelloWorld 1.6 - + + + ${libs.restlib.classpath} + WEB-INF/lib + + - + - + Index: websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/CustomerDBClientSampleWizardIterator.java =================================================================== RCS file: /cvs/websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/Attic/CustomerDBClientSampleWizardIterator.java,v retrieving revision 1.5 diff -u -r1.5 CustomerDBClientSampleWizardIterator.java --- websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/CustomerDBClientSampleWizardIterator.java 26 Oct 2007 22:02:39 -0000 1.5 +++ websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/CustomerDBClientSampleWizardIterator.java 28 Mar 2008 17:00:43 -0000 @@ -41,18 +41,13 @@ package org.netbeans.modules.websvc.rest.samples.ui; -import java.io.BufferedReader; import java.io.File; -import java.io.FileReader; import java.io.IOException; -import java.io.OutputStreamWriter; import java.util.Set; import org.netbeans.spi.project.ui.support.ProjectChooser; import org.openide.WizardDescriptor; -import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; -import org.openide.util.NbBundle; /** * @@ -68,21 +63,16 @@ return new CustomerDBClientSampleWizardIterator(); } - protected String[] createSteps() { - return new String[] { - NbBundle.getMessage(CustomerDBClientSampleWizardIterator.class, "MSG_NameAndLocation"), - }; - } - + @Override protected WizardDescriptor.Panel[] createPanels() { return new WizardDescriptor.Panel[] { new CustomerDBClientSampleWizardPanel() }; } + @Override public Set instantiate() throws IOException { setProjectConfigNamespace(null); - setAddJerseyLibrary(false); Set resultSet = super.instantiate(); //replace tokens Index: websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/CustomerDBSampleWizardIterator.java =================================================================== RCS file: /cvs/websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/Attic/CustomerDBSampleWizardIterator.java,v retrieving revision 1.5 diff -u -r1.5 CustomerDBSampleWizardIterator.java --- websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/CustomerDBSampleWizardIterator.java 18 Jan 2008 02:09:04 -0000 1.5 +++ websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/CustomerDBSampleWizardIterator.java 28 Mar 2008 17:00:43 -0000 @@ -64,18 +64,14 @@ return new CustomerDBSampleWizardIterator(); } - protected String[] createSteps() { - return new String[] { - NbBundle.getMessage(CustomerDBSampleWizardIterator.class, "MSG_NameAndLocation"), - }; - } - + @Override protected WizardDescriptor.Panel[] createPanels() { return new WizardDescriptor.Panel[] { new CustomerDBSampleWizardPanel(), }; } + @Override public Set instantiate() throws IOException { setProjectConfigNamespace(null); Set resultSet = super.instantiate(); Index: websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/HelloWorldSampleWizardIterator.java =================================================================== RCS file: /cvs/websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/Attic/HelloWorldSampleWizardIterator.java,v retrieving revision 1.4 diff -u -r1.4 HelloWorldSampleWizardIterator.java --- websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/HelloWorldSampleWizardIterator.java 26 Oct 2007 22:02:39 -0000 1.4 +++ websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/HelloWorldSampleWizardIterator.java 28 Mar 2008 17:00:43 -0000 @@ -48,7 +48,6 @@ import org.openide.WizardDescriptor; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; -import org.openide.util.NbBundle; /** * @@ -64,18 +63,14 @@ return new HelloWorldSampleWizardIterator(); } - protected String[] createSteps() { - return new String[] { - NbBundle.getMessage(HelloWorldSampleWizardIterator.class, "MSG_NameAndLocation"), - }; - } - + @Override protected WizardDescriptor.Panel[] createPanels() { return new WizardDescriptor.Panel[] { new HelloWorldSampleWizardPanel(), }; } + @Override public Set instantiate() throws IOException { setProjectConfigNamespace(null); Set resultSet = super.instantiate(); @@ -104,6 +99,4 @@ ProjectChooser.setProjectsFolder(FileUtil.toFile(dirParent.getParent())); return resultSet; } - - } Index: websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/SampleWizardIterator.java =================================================================== RCS file: /cvs/websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/Attic/SampleWizardIterator.java,v retrieving revision 1.4 diff -u -r1.4 SampleWizardIterator.java --- websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/SampleWizardIterator.java 5 Oct 2007 17:52:57 -0000 1.4 +++ websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/SampleWizardIterator.java 28 Mar 2008 17:00:43 -0000 @@ -48,7 +48,6 @@ import java.io.FileReader; import java.io.IOException; import java.io.OutputStreamWriter; -import java.text.MessageFormat; import java.util.Enumeration; import java.util.LinkedHashSet; import java.util.NoSuchElementException; @@ -57,13 +56,9 @@ import javax.swing.event.ChangeListener; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectManager; -import org.netbeans.modules.websvc.rest.samples.ui.SampleWizardPanel; -import org.netbeans.modules.websvc.rest.samples.util.Log; -import org.netbeans.modules.websvc.rest.samples.util.RestSampleProjectProperties; import org.netbeans.modules.websvc.rest.samples.util.RestSampleUtils; import org.netbeans.spi.project.ui.support.ProjectChooser; import org.netbeans.spi.project.ui.templates.support.Templates; -import org.openide.ErrorManager; import org.openide.WizardDescriptor; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; @@ -83,8 +78,7 @@ private transient int index; private transient WizardDescriptor.Panel[] panels; public transient WizardDescriptor wiz; - private boolean addJerseyLibrary = true; - private String projectConfigNamespace = RestSampleProjectProperties.WEB_PROJECT_CONFIGURATION_NAMESPACE; + private String projectConfigNamespace = "http://www.netbeans.org/ns/web-project/3"; //NOI18N public SampleWizardIterator() {} @@ -100,7 +94,7 @@ protected String[] createSteps() { return new String[] { - NbBundle.getMessage(SampleWizardIterator.class, "MSG_SampleProject"), + NbBundle.getMessage(SampleWizardIterator.class, "MSG_NameAndLocation"), }; } @@ -112,11 +106,7 @@ this.projectConfigNamespace = namespace; } - public void setAddJerseyLibrary(boolean flag) { - addJerseyLibrary = flag; - } - - public Set/**/ instantiate() throws IOException { + public Set instantiate() throws IOException { Set resultSet = new LinkedHashSet(); File dirF = FileUtil.normalizeFile((File) wiz.getProperty(PROJDIR)); dirF.mkdirs(); @@ -132,6 +122,7 @@ dirF = FileUtil.toFile(dir); RestSampleUtils.unZipFile(template.getInputStream(), dir); + ProjectManager.getDefault().clearNonProjectCache(); if (projectConfigNamespace != null) RestSampleUtils.setProjectName(dir, projectConfigNamespace, name); @@ -139,9 +130,6 @@ Project p = ProjectManager.getDefault().findProject(dir); myProject = p; - if (addJerseyLibrary) - RestSampleUtils.addJerseyLibrary(myProject); - // Always open top dir as a project: resultSet.add(dir); // Look for nested projects to open as well: @@ -193,8 +181,7 @@ } public String name() { - return MessageFormat.format("{0} of {1}", //NOI18N - new Object[] {new Integer (index + 1), new Integer (panels.length)}); + return current().getComponent().getName(); } public boolean hasNext() { Index: websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/SampleWizardPanelVisual.java =================================================================== RCS file: /cvs/websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/Attic/SampleWizardPanelVisual.java,v retrieving revision 1.2 diff -u -r1.2 SampleWizardPanelVisual.java --- websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/SampleWizardPanelVisual.java 5 Oct 2007 17:52:55 -0000 1.2 +++ websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/ui/SampleWizardPanelVisual.java 28 Mar 2008 17:00:43 -0000 @@ -72,6 +72,8 @@ // Register listener on the textFields to make the automatic updates projectNameTextField.getDocument().addDocumentListener( this ); projectLocationTextField.getDocument().addDocumentListener( this ); + // Provide a name in the title bar. + setName(NbBundle.getMessage(SampleWizardPanelVisual.class, "MSG_NameAndLocation")); //NOI18N } protected String getDefaultProjectName() { Index: websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/util/RestSampleUtils.java =================================================================== RCS file: /cvs/websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/util/Attic/RestSampleUtils.java,v retrieving revision 1.3 diff -u -r1.3 RestSampleUtils.java --- websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/util/RestSampleUtils.java 5 Oct 2007 18:02:08 -0000 1.3 +++ websvc/restsamples/src/org/netbeans/modules/websvc/rest/samples/util/RestSampleUtils.java 28 Mar 2008 17:00:43 -0000 @@ -42,22 +42,13 @@ package org.netbeans.modules.websvc.rest.samples.util; -import java.io.*; -import java.util.Enumeration; -import java.util.Properties; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import org.netbeans.api.project.Project; -import org.netbeans.api.java.classpath.ClassPath; -import org.netbeans.api.java.project.JavaProjectConstants; -import org.netbeans.api.java.project.classpath.ProjectClassPathModifier; -import org.netbeans.api.project.ProjectUtils; -import org.netbeans.api.project.SourceGroup; -import org.netbeans.api.project.libraries.Library; -import org.netbeans.api.project.libraries.LibraryManager; -import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; import org.netbeans.spi.project.support.ant.AntProjectHelper; -import org.netbeans.spi.project.support.ant.EditableProperties; import org.openide.ErrorManager; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; @@ -102,135 +93,6 @@ } } - public static void unZipFileTranslateProjectName(InputStream source, FileObject rootFolder, String name, String token) throws IOException { - try { - ZipInputStream str = new ZipInputStream(source); - ZipEntry entry; - while ((entry = str.getNextEntry()) != null) { - if (entry.isDirectory()) { - FileUtil.createFolder(rootFolder, entry.getName()); - continue; - } - String fname = entry.getName(); - FileObject fo = FileUtil.createData(rootFolder, fname); - FileLock lock = fo.lock(); - try { - OutputStream out = fo.getOutputStream(lock); - try { - if (needTranslation(fname)) { - translateProjectName(str, out, name, token); - } else { - FileUtil.copy(str, out); - } - } finally { - out.close(); - } - } finally { - lock.releaseLock(); - } - } - } finally { - source.close(); - } - } - - static boolean needTranslation(String fname) { - for (int i = 0; i < xlateFiles.length; i++) { - if (fname.endsWith(xlateFiles[i])) { - return true; - } - } - return false; - } - - static void translateProjectName(InputStream str, OutputStream out, String name, String token) throws IOException { - ByteArrayOutputStream bo = new ByteArrayOutputStream(); - FileUtil.copy(str, bo); - ByteArrayInputStream bi = new ByteArrayInputStream(bo.toString().replaceAll(token, name).getBytes()); - FileUtil.copy(bi, out); - } - - public static FileObject getStudioUserDir() { - Log.out("StudioUserDir: " + FileUtil.toFileObject(new File(System.getProperty("netbeans.user"))).getPath()); // NOI18N - return FileUtil.toFileObject(new File(System.getProperty("netbeans.user"))); // NOI18N - } - - public static FileObject getProjectFolder(FileObject parentDir, String projectDirName) { - assert parentDir != null : parentDir + "/" + projectDirName + "doesn't exist"; // NOI18N - assert projectDirName != null : "project name can't be empty"; // NOI18N - return parentDir.getFileObject(projectDirName); - } - - private static FileObject getFolder(String relative) { - return getFolder(getStudioUserDir(), relative); - } - - private static FileObject getFolder(FileObject parent, String relative) { - FileObject folder = parent.getFileObject(relative); - if (folder != null) { - return folder; - } - try { - folder = parent.createFolder(relative); - } catch (IOException ioe) { - ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, ioe); - } - return folder; - } - - private static String getPropertiesPath(String name) { - return RestSampleProjectProperties.getDefault().isPrivateProperty(name) ? AntProjectHelper.PRIVATE_PROPERTIES_PATH : AntProjectHelper.PROJECT_PROPERTIES_PATH; - } - - private static AntProjectHelper getAntProjectHelper(Project project) { - return (AntProjectHelper) project.getLookup().lookup(AntProjectHelper.class); - } - - public static void setPrivateProperty(FileObject prjLoc, String name, String value) { - Properties properties = new Properties(); - try { - properties.setProperty(name, value); - - FileObject propFile = FileUtil.createData(prjLoc, AntProjectHelper.PRIVATE_PROPERTIES_PATH); - FileLock lock = propFile.lock(); - OutputStream os = propFile.getOutputStream(lock); - try { - properties.store(os, null); - } finally { - os.close(); - lock.releaseLock(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static String getProperty(Project project, String name) { - return getProperties(project, name).getProperty(name); - } - - private static EditableProperties getProperties(Project project, String name) { - AntProjectHelper helper = getAntProjectHelper(project); - assert helper != null : "Can't get AntProjectHelper for project: " + project; - return helper.getProperties(getPropertiesPath(name)); - } - - /** - * @return SunApp default server instance location - */ - public static String getDefaultSunAppLocation() { - String loc = null; - String[] instances = InstanceProperties.getInstanceList(); - for (String instanceId : instances) { - if (instanceId.indexOf(RestSampleProjectProperties.SERVER_INSTANCE_SUN_APPSERVER) != -1) { - int endIdx = instanceId.indexOf(']'); - loc = instanceId.substring(1, endIdx); - break; - } - } - return loc; - } - /** * Method taken from NB anagram code. */ @@ -291,65 +153,6 @@ } } finally { lock.releaseLock(); - } - } - - public static void insertParameters(FileObject dir, String bpelProjDir) { - Enumeration files = dir.getData(true); - - while (files.hasMoreElements()) { - FileObject fileObject = (FileObject) files.nextElement(); - - if (fileObject.isFolder()) { - continue; - } - if (!((fileObject.getExt().toLowerCase().equals("xml") || fileObject.getExt().toLowerCase().equals("properties")))) { - // NOI18N - continue; - } - String line; - StringBuffer buffer = new StringBuffer(); - - try { - InputStream inputStream = fileObject.getInputStream(); - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); - - while ((line = reader.readLine()) != null) { - line = line.replace("__BPELPROJECTNAME__", bpelProjDir); // NOI18N - buffer.append(line); - buffer.append("\n"); // NOI18N - } - - File file = FileUtil.toFile(fileObject); - OutputStream outputStream = new FileOutputStream(file); - PrintWriter writer = new PrintWriter(outputStream); - writer.write(buffer.toString()); - writer.flush(); - outputStream.close(); - } catch (IOException ex) { - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); - } - } - } - - public static void addJerseyLibrary(Project project) { - Library jerseyLibrary = LibraryManager.getDefault().getLibrary(JERSEY_LIBRARY); - - if (jerseyLibrary == null) { - System.out.println("no jersey library found"); - return; - } - - SourceGroup[] sgs = ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); - FileObject sourceRoot = sgs[0].getRootFolder(); - String[] classPathTypes = new String[]{ClassPath.COMPILE, ClassPath.EXECUTE}; - - for (String type : classPathTypes) { - try { - ProjectClassPathModifier.addLibraries(new Library[]{jerseyLibrary}, sourceRoot, type); - } catch (Exception ex) { - ex.printStackTrace(); - } } } } Index: websvc/swdp/manifest.mf =================================================================== RCS file: /cvs/websvc/swdp/Attic/manifest.mf,v retrieving revision 1.7.2.2 diff -u -r1.7.2.2 manifest.mf --- websvc/swdp/manifest.mf 11 Mar 2008 22:02:46 -0000 1.7.2.2 +++ websvc/swdp/manifest.mf 28 Mar 2008 17:00:44 -0000 @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.restlib/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/swdp/Bundle.properties -OpenIDE-Module-Specification-Version: 0.6 +OpenIDE-Module-Specification-Version: 0.6.0.2 OpenIDE-Module-Layer: org/netbeans/modules/websvc/swdp/layer.xml AutoUpdate-Show-In-Client: false Index: websvc/swdp/external/rest.zip =================================================================== RCS file: /cvs/websvc/swdp/external/Attic/rest.zip,v retrieving revision 1.17.2.2 diff -u -r1.17.2.2 rest.zip Binary files /tmp/cvsgga4WW and rest.zip differ Index: websvc/swdp/nbproject/project.properties =================================================================== RCS file: /cvs/websvc/swdp/nbproject/Attic/project.properties,v retrieving revision 1.13.2.1 diff -u -r1.13.2.1 project.properties --- websvc/swdp/nbproject/project.properties 11 Mar 2008 22:02:49 -0000 1.13.2.1 +++ websvc/swdp/nbproject/project.properties 28 Mar 2008 17:00:58 -0000 @@ -50,7 +50,8 @@ modules/ext/rest/comresrcgen.jar,\ modules/ext/rest/http.jar,\ modules/ext/rest/grizzly-http-webserver-1.7.2.jar,\ - modules/ext/rest/rest-license.txt + modules/ext/rest/rest-license.txt,\ + docs/jsr311-api-doc.zip javac.source=1.5 release.external/rest.zip!/jsr311-api.jar=modules/ext/rest/jsr311-api.jar @@ -65,3 +66,6 @@ release.external/rest.zip!/comresrcgen.jar=modules/ext/rest/comresrcgen.jar release.external/rest.zip!/http.jar=modules/ext/rest/http.jar release.external/rest.zip!/grizzly-http-webserver-1.7.2.jar=modules/ext/rest/grizzly-http-webserver-1.7.2.jar + +# JSR-311 Javadoc +release.external/jsr311-api-doc.zip=docs/jsr311-api-doc.zip Index: websvc/swdp/src/org/netbeans/modules/websvc/swdp/restapi.xml =================================================================== RCS file: /cvs/websvc/swdp/src/org/netbeans/modules/websvc/swdp/Attic/restapi.xml,v retrieving revision 1.2.8.1 diff -u -r1.2.8.1 restapi.xml --- websvc/swdp/src/org/netbeans/modules/websvc/swdp/restapi.xml 11 Mar 2008 22:02:50 -0000 1.2.8.1 +++ websvc/swdp/src/org/netbeans/modules/websvc/swdp/restapi.xml 28 Mar 2008 17:00:58 -0000 @@ -51,4 +51,8 @@ classpath jar:nbinst:///modules/ext/rest/jsr311-api.jar!/ + + javadoc + jar:nbinst:///docs/jsr311-api-doc.zip!/ + Index: websvc/swdp/src/org/netbeans/modules/websvc/swdp/swdp.xml =================================================================== RCS file: /cvs/websvc/swdp/src/org/netbeans/modules/websvc/swdp/Attic/swdp.xml,v retrieving revision 1.16.2.1 diff -u -r1.16.2.1 swdp.xml --- websvc/swdp/src/org/netbeans/modules/websvc/swdp/swdp.xml 11 Mar 2008 22:02:50 -0000 1.16.2.1 +++ websvc/swdp/src/org/netbeans/modules/websvc/swdp/swdp.xml 28 Mar 2008 17:00:58 -0000 @@ -68,4 +68,8 @@ jar:nbinst:///modules/ext/rest/asm-3.1.jar!/ jar:nbinst:///modules/ext/rest/grizzly-http-webserver-1.7.2.jar!/ + + javadoc + jar:nbinst:///docs/jsr311-api-doc.zip!/ +